On Wednesday, 9 March 2016 at 22:54:13 UTC, bigsandwich wrote:
On Wednesday, 9 March 2016 at 22:05:28 UTC, Ola Fosheim Grøstad wrote:[...]Yes, I do. std::function<> uses type erasure to store a "function". If its small enough, its stored internally, otherwise it goes on the heap. It uses RAII to manage the lifetime of the lambda. D is using the GC for managing the lifetime. D doesn't have a way of doing this without the GC.
D can do it too, there's just no syntactic sugar for it. Atila