Use case for std.bind

downs default_357-line at yahoo.de
Sun Feb 22 23:15:15 PST 2009


Let me say first that I don't use std.bind myself, but tools.base:fix fills essentially the same need - creating full closures from dynamic ones.

Say you have a function that takes a number and returns a delegate that does something with that number.

void delegate() test(int i) { return { return i + 2; }; }

In 2.0 this will ......................

Oh.

Nevermind. I don't know what to use bind for after all :)

In fact, I suspect it's essentially useless in 2.0. Creating full closures was my only use case :)



More information about the Digitalmars-d mailing list