[C++-sig] operator definitions

David Abrahams dave at boost-consulting.com
Sun Apr 9 04:37:09 CEST 2006


Neal Becker <ndbecker2 at gmail.com> writes:

> David Abrahams wrote:
>
>> Neal Becker <ndbecker2 at gmail.com> writes:
>> 
>>> It looks cool, but IMHO a bit too cute.  AFAIK, it doesn't do anything
>>> different than the IMHO much more clear:
>>>     .def("__iadd__", plusAssignOp, return_self<>())
>> 
>> How is that more clear?  *I* certainly can't tell what it means.
>> 
>
> It's clear (to me) because it's consistent with the same method used to
> define any other function.  In this case "clear" assumes the observer is
> already familiar with the usual useage of .def.

And with the meaning of plusAssignOp and return_self<>()

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Cplusplus-sig mailing list