function pointer bug?
bitwise via Digitalmars-d
digitalmars-d at puremagic.com
Mon Oct 27 18:10:35 PDT 2014
> C++ compiler does some trickery behind the curtains. besides,
> you
> aren't supposed to make such hackish things easily in D. yet
> you can:
There is nothing hackish in the above code. It's a non-type
template parameter and a member function pointer. If I was trying
to access the (implementation dependant)vtable pointer in C++ to
call the function manually, I may concede to calling it a hack,
but there is nothing non-standard about the above code.
>>D is not C++, and D delegates aren't C++ member function
>>pointers (yet they works nearly the same).
I was simply trying to show that what I wanted to do was possible
in a similar language.
I still believe it's a bug in the language. In the original code,
both test cases should either both work, or both fail to compile.
I have looked through the D docs online, and can't find anything
supporting the argument that this is the intended behaviour of
the compiler.
More information about the Digitalmars-d
mailing list