Boost logo

Boost :

Subject: Re: [boost] [operators] A modern SFINAE-based version of boost::operators?
From: Hans Dembinski (hans.dembinski_at_[hidden])
Date: 2017-11-14 08:43:04

Dear Daniel,

> On 13. Nov 2017, at 17:26, Daniel Frey via Boost <boost_at_[hidden]> wrote:
> I worked on other improvements, which ultimately went into its own library: <>. There, I distinguish between commutative and non-commutative versions of some operators, as they allow me to provide additional optimisations (leading to fewer temporaries). This could not be done with a detection-style approach as the presence of an operator+ will not tell you whether or not it is commutative. It also plays some tricks returning rvalue-references which some people don't like (or consider dangerous), so it's not suitable for Boost.Operators.

when I was looking into operators for the histogram library, I also considered Boost.Operators and I also looked into your taocpp/operators.

I was wondering why are the rvalue-optimised versions of operators are not already part of Boost.Operators? I don't know what kind of tricks you are talking about, surely there must be rvalue-enabled versions that are standard compliant and safe, like the implementations that Richard Hodges mentioned. This seems like a straight-forward improvement of Boost.Operators that doesn't break old code. Or am I missing something?

Best regards,

Boost list run by bdawes at, gregod at, cpdaniel at, john at