On Thursday, 19 March 2020 at 23:46:01 UTC, Boris Carvajal wrote:
https://issues.dlang.org/show_bug.cgi?id=20687
https://github.com/dlang/dmd/pull/10946
Thanks very much for such a quick fix.
On Thursday, 19 March 2020 at 14:43:53 UTC, Steven Schveighoffer
wrote:
I think this is an invalid limitation, you should file an issue
at https://issues.dlang.org
essentially, with your sample A struct:
const f1 = &A.fn; // OK
const f2 = &A.d; // Error, not constant expression
Both these sho
On 3/19/20 9:40 AM, Calvin P wrote:
On Monday, 16 March 2020 at 18:43:47 UTC, Steven Schveighoffer wrote:
enum A0 = &A.d;
Note that you can't call it at all, but you can get the function
pointer, and put it into a delegate later by assigning .funcptr.
void main()
{
A a;
void delegat
On Thursday, 19 March 2020 at 13:23:41 UTC, Adam D. Ruppe wrote:
Check the error message there... you already have a function
pointer, no need to use the .funcptr metod.
It is a bit weird though because it actually EXCLUDES the
hidden argument for `this`. I prefer doing wrapper functions
us
On Monday, 16 March 2020 at 18:43:47 UTC, Steven Schveighoffer
wrote:
enum A0 = &A.d;
Note that you can't call it at all, but you can get the
function pointer, and put it into a delegate later by assigning
.funcptr.
void main()
{
A a;
void delegate() dg;
dg.ptr = &a;
dg.func
On Thursday, 19 March 2020 at 04:30:32 UTC, Calvin P wrote:
my question is, how to get it in compile time like static
function address:
=
struct A {
void d(){};
static void fn(){};
}
enum FN = &A.fn; // static method address is ok
enum A1 = (&__traits(getMember, A,"d")).func
On Thursday, 19 March 2020 at 06:34:40 UTC, Alex wrote:
A non-static member method can use the context of the struct
where it is defined in. E.g. it could alter a member variable.
This context has to be constructed at run time (and there could
be many instances of the context) and does not exist
On Thursday, 19 March 2020 at 04:30:32 UTC, Calvin P wrote:
I use this code to get member function address on runtime:
=
struct A {
this(){};
}
auto ctor = (&__traits(getMember, A.init,"__ctor")).funcptr;
=
my question is, how to get it in compile time like static
funct
On Thursday, 19 March 2020 at 04:30:32 UTC, Calvin P wrote:
I use this code to get member function address on runtime:
=
struct A {
this(){};
}
auto ctor = (&__traits(getMember, A.init,"__ctor")).funcptr;
=
my question is, how to get it in compile time like static
funct
I use this code to get member function address on runtime:
=
struct A {
this(){};
}
auto ctor = (&__traits(getMember, A.init,"__ctor")).funcptr;
=
my question is, how to get it in compile time like static
function address:
=
struct A {
void d(){};
sta
On 3/14/20 5:06 AM, Calvin P wrote:
I use this code to get member function address on runtime:
=
struct A {
this(){};
}
auto ctor = (&__traits(getMember, A.init,"__ctor")).funcptr;
=
my question is, how to get it in compile time like static function address:
=
I use this code to get member function address on runtime:
=
struct A {
this(){};
}
auto ctor = (&__traits(getMember, A.init,"__ctor")).funcptr;
=
my question is, how to get it in compile time like static
function address:
=
struct A {
void d(){};
sta
12 matches
Mail list logo