Understanding Safety of Function Pointers vs. Addresses of Functions

jmh530 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 7 20:31:41 PDT 2015


I'm still not sure why I'm getting the error I mention in the 
original post. For instance, the code below is giving that Error 
42 Symbol Undefined error. Seems very mystifying...

import std.math : cos;

real foo(T)(T fp, real x)
{
	return fp(x);
}

void main()
{
	real x = 0;
	real y = foo(&cos, x);
}


More information about the Digitalmars-d-learn mailing list