Boost logo

Boost Users :

From: Marc Horowitz (marc_at_[hidden])
Date: 2008-06-16 04:45:39


"Ovanes Markarian" <om_boost_at_[hidden]> writes:

>> 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<const char*>(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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net