Comparing function pointers

Freddy via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 11 10:40:03 PST 2015


----
import std.stdio;

auto test1(){
	void testFunc(){
	}
	return &testFunc;
}

auto test2(){
	uint a;
	void testFunc(){
		a=1;
	}
	return &testFunc;
}

void main(){
	writeln(test1()==test1());//true
	writeln(test2()==test2());//false
}
----
Is the intended behavior?


More information about the Digitalmars-d-learn mailing list