4 Jul
2003
4 Jul
'03
6:43 p.m.
-----Original Message----- From: Jaakko Jarvi [mailto:jajarvi@cs.indiana.edu] <snip>
Any clues?
There seems to be two things. First, LL can't deduce the return type of gen_long() call. That is a bit odd, as the class seems to define result_type, which should be enough. Anyway, that can be fixed with
bind<long>(gen_long)
Then your gen_long is a stateful object, and the operator() is not defined as const. Lambda functors store all arguments by default as const copies. You must thus tell the library to store a reference to your original function object:
bind<long>(ref(gen_long))
var does just as well:
bind<long>(var(gen_long))
Cheers, Jaakko
Beautiful. Thanks mate. Matt.