On Wednesday, August 2, 2023 12:02:35 PM MDT Nick Treleaven via Digitalmars-d-
learn wrote:
> On Wednesday, 2 August 2023 at 17:55:12 UTC, Nick Treleaven wrote:
> > On Wednesday, 2 August 2023 at 17:52:00 UTC, Nick Treleaven
> >
> > wrote:
> >> Now I'm wondering why those functions are marked
On Wednesday, 2 August 2023 at 17:55:12 UTC, Nick Treleaven wrote:
On Wednesday, 2 August 2023 at 17:52:00 UTC, Nick Treleaven
wrote:
Now I'm wondering why those functions are marked `pure` - they
must affect the GC's bookkeeping state.
I guess it was because the GC's internal state is not
On Wednesday, 2 August 2023 at 17:52:00 UTC, Nick Treleaven wrote:
Now I'm wondering why those functions are marked `pure` - they
must affect the GC's bookkeeping state.
Here's the pull that added it:
https://github.com/dlang/druntime/pull/3561
Hi Guys!
In my programm, I have a custom String-type that I want to
initialize some variables of at compile time by casting a string
literal to said custom String type. I thought I could achieve
this straight forwardly, but after trying a bit, I could not find
a (simple) working solution. I
On 27.02.19 19:10, Dukc wrote:
I tested a bit, and it appears that attribute inference is not done at
all for templates inside structs -the attribute need not be a delegate:
struct S
{
static int fImpl(Ret)() { return Ret.init; }
pragma(msg,
On Wednesday, 27 February 2019 at 17:23:21 UTC, Q. Schroll wrote:
For whatever reason, when I put the code in a struct, the @safe
testing line tells me, it's @system now.
I tested a bit, and it appears that attribute inference is not
done at all for templates inside structs -the attribute
On Wednesday, 27 February 2019 at 18:06:49 UTC, Stefan Koch wrote:
the struct gets drawn into your delegate-context.
and I guess that taints the function.
Even if it did, it should not make the delegate @system. And it
does not, since this manifest with static functions and function
On Wednesday, 27 February 2019 at 17:23:21 UTC, Q. Schroll wrote:
I have a template function `fImpl` I whish to instantiate
manually using the new name `f`. Reason is simple: `f` should
not be a template, but overloading it makes it easier that way.
Nothing's more simple in D:
[...]
the
I have a template function `fImpl` I whish to instantiate
manually using the new name `f`. Reason is simple: `f` should not
be a template, but overloading it makes it easier that way.
Nothing's more simple in D:
int fImpl(T)(T value) { return cast(int) value; }
alias f = fImpl!int;
The following program compiles, and does what you'd expect:
struct A {
int a;
}
pure int func( ref A a )
{
return a.a += 3;
}
As far as I can tell, however, it shouldn't. I don't see how or
why func can possibly be considered pure, as it changes a state
external to the function.
On Monday, 25 August 2014 at 06:27:00 UTC, Shachar wrote:
The following program compiles, and does what you'd expect:
struct A {
int a;
}
pure int func( ref A a )
{
return a.a += 3;
}
As far as I can tell, however, it shouldn't. I don't see how or
why func can possibly be considered
11 matches
Mail list logo