Dicebot on leaving D: It is anarchy driven development in all its glory.

Walter Bright newshound2 at digitalmars.com
Sat Aug 25 01:43:19 UTC 2018


On 8/24/2018 4:22 PM, tide wrote:
> struct SomeStruct
> {
>      void foo() {
>          // use SomeStruct
>      }
> }
> 
> 
> void broken()
> {
>      void function() foo = &SomeStruct.foo;
>      foo(); // runtime error, isn't actually safe uses wrong calling convention 
> as well
> }
> 
> Not really lack of feature so much as there exists broken code. This has been 
> valid code for god knows how long. At some point it was usable in @safe, but it 
> looks you can't take an address of a member function without "this" as well in 
> safe anymore.


That's because it isn't safe. But being able to take the address is important 
for system work.


More information about the Digitalmars-d mailing list