
On 9/13/2011 11:38 AM, Nevin Liber wrote:
On 13 September 2011 11:13, Dave Abrahams
wrote: I know this isn't the answer you're looking for, but IMO you should just avoid std::binary_function and friends. They don't buy you anything you can't get from embedding the typedefs directly, and they can inhibit the empty base optimization.
And they are deprecated in C++11 (along with mem_fun and mem_fun_ref, for that matter).
Thanks. So what is the "best practice" for creating something that plays well with older compilers that don't have decltype or all the C++11 features? What kinds of things are first_argument_type and second_argument_type needed for? I'm supposing that they would make bind smarter, work better perhaps, or give more sensible error messages. If mem_fun etc. are deprecated in favor of just using function and bind, then is there also a general extension mechanism defined? That is, tell subsequent uses of bind just what to do with first arguments of that nature? —John