
16 Jun
2008
16 Jun
'08
8:45 a.m.
"Ovanes Markarian"
in this case template deduction does not work (or works a bit different as assumed).
This one should work: (std::tr1::bind(f, _1))(static_cast
(NULL));
This works, but it is inconvenient. It is not always clear at first what the type of an argument which takes NULL is, especially if one is modifying existing code. You can compile, see what the error message says, and copy that type into the code, but I was hoping to avoid this.
NullPlaceholder works, because it makes the cast in operator() for you.
Yes, I am aware of this, which is why I wrote it that way. I was hoping to learn if someone had developed a cleaner workaround, and to get the documentation improved if not. Marc