On Monday, 9 October 2023 at 16:33:32 UTC, rempas wrote:
However, in my example, "stringof" returns the character "i"
itself and turns that into a string instead of getting its
actual value (number).
The result of `.stringof` is implementation defined, it can be
used for debugging but don't m
On Monday, 9 October 2023 at 18:25:15 UTC, rempas wrote:
On Monday, 9 October 2023 at 17:42:48 UTC, Imperatorn wrote:
You could just add your own int to string I guess?
That will be a good idea! I'll do it in the future if that is
the case, as it's not important, and I want to finish my job.
On Monday, 9 October 2023 at 22:49:11 UTC, Salih Dincer wrote:
Great masters generally warn to stay away from stringof. Please
do not use it as much as possible. The following code snippet
will be useful to you:
```d
alias CN = __traits(allMembers, CardinalNumbers);
static foreach(i; CN)
{
On Tuesday, 10 October 2023 at 05:32:52 UTC, Imperatorn wrote:
If count < 10 then why not just
```d
import std;
static foreach(c; "0123456789")
{
mixin(create_fn!(c));
}
enum create_fn(char num) = `
auto function_`~ num ~`()
=> "Hello from function `~ num ~`
On Tuesday, 10 October 2023 at 11:45:25 UTC, Dennis wrote:
The result of `.stringof` is implementation defined, it can be
used for debugging but don't make your program's semantics
depend on the output of it.
...
...
...That being said, this trick can be used to convert an
integer to string
On Tuesday, 10 October 2023 at 11:46:38 UTC, Hipreme wrote:
My engine has its own implementation of toString(long), which
does not have dependency with the C runtime:
https://github.com/MrcSnm/HipremeEngine/blob/master/modules/util/source/hip/util/conv.d#L180C1-L208C2
I have reimplemented the
On Tuesday, 10 October 2023 at 13:55:44 UTC, rempas wrote:
On Tuesday, 10 October 2023 at 11:46:38 UTC, Hipreme wrote:
My engine has its own implementation of toString(long), which
does not have dependency with the C runtime:
https://github.com/MrcSnm/HipremeEngine/blob/master/modules/util/sou
On Friday, 6 October 2023 at 13:44:14 UTC, d007 wrote:
I am search for a fast 128bit integer ucent boolfilter, used
for server side duplicate request filter.
Is 128bit boolfilter a doable thing? or it will not work or
will be much more slow compare to 64 bit solution?
Can you describe or gi
On Monday, 2 October 2023 at 18:34:13 UTC, BoQsc wrote:
---
**This might lead to less gaps between math formulas and the
implementation.**
Or at the very least would allow to define a formula in the
source code for further implementation and introduce some
consistency.
You could write a pa
Hi,
I want to confirm: in the following loop, is the array literal
`a` vs. `b` stack or heap allocated? and how many times?
void main() {
int[2] a;
int[] b;
int i;
While(++i <=100) {
a = [i, i+1]; // array literal
b = [i, i+1];
}
}
Thanks.
On Wed, Oct 11, 2023 at 02:54:53AM +, mw via Digitalmars-d-learn wrote:
> Hi,
>
> I want to confirm: in the following loop, is the array literal `a` vs.
> `b` stack or heap allocated? and how many times?
>
> void main() {
>
> int[2] a;
This is stack-allocated. Once per call to the function.
On Wednesday, 11 October 2023 at 02:54:53 UTC, mw wrote:
Hi,
I want to confirm: in the following loop, is the array literal
`a` vs. `b` stack or heap allocated? and how many times?
void main() {
int[2] a;
int[] b;
int i;
While(++i <=100) {
a = [i, i+1]; // array literal
b = [i, i+1];
On Wednesday, 11 October 2023 at 03:15:30 UTC, H. S. Teoh wrote:
On Wed, Oct 11, 2023 at 02:54:53AM +, mw via
Digitalmars-d-learn wrote:
Hi,
I want to confirm: in the following loop, is the array literal
`a` vs. `b` stack or heap allocated? and how many times?
void main() {
int[2] a;
On Wednesday, 11 October 2023 at 02:54:53 UTC, mw wrote:
Hi,
I want to confirm: in the following loop, is the array literal
`a` vs. `b` stack or heap allocated? and how many times?
void main() {
int[2] a;
int[] b;
int i;
While(++i <=100) {
a = [i, i+1]; // array literal
b = [i, i+1];
14 matches
Mail list logo