While on the subject, taking the address of a struct's method returns an incorrect type that allows it to be called incorrectly even with @safe. Which is a bit ironic cause then it can't be cast'd to a type that is actually safe to use.

    auto func = &SomeStruct.someFunc;
func(); // ops runtime error, allows calling function that needs an object

C++ makes this a pointer to a member function which looks like: "void (SomeStruct::*)()" for the example above. Either way for safety and just having a defined way to call a pointer to a member function would be nice.

Reply via email to