of course I mean:
Foo operator+(Foo l, Foo const& r) { return l += r; return l; }
in the second version.
On 13 November 2017 at 16:05, Richard Hodges
I for one would be grateful for work on this. Particularly if it also automatically manufactures move-aware versions of binary operators.
eg:
Foo&& operator+(Foo&& l, Foo const& r) { return std::move(l += r); } Foo operator+(Foo const& l, Foo const& r) { return l += r; return l; }
On 13 November 2017 at 15:20, Beman Dawes via Boost
wrote:
Peter Sommerlad, committee member and C++Now presenter who often proposes additions to fill in holes in the standard library, asked me:
Are you aware of anybody who tried to provide a boost::operators style of automatically providing additional operators with a single base class that through SFINAE injects all possible operators based on the ones defined in the template parameter? This won't give you the control of the current boost::operators, but would be much easier to teach.
For example
struct Me : make_operators_for<Me>{ Me& operator+=(Me const&); // You get + bool operator<(Me const&) const; // You get all relops (<=> will make that obsolete) Me& operator++(); // you get postfix //etc. };
Today we have the facilities and compilers to make that happen.
What do you think? Who should I ask?
Anyone doing any work on operators or have any thoughts about updating boost::operators?
--Beman
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman /listinfo.cgi/boost