On Wed, 11 Feb 2015 18:40:03 +0000, Freddy wrote: > ---- > 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?
second thing is not a function, it's a closure (fat pointer internally). each time you calling `test2()`, you creating new closure. so yes, this is intended behavior.
signature.asc
Description: PGP signature