
On 25.04.2013, at 23:04, Marc Glisse
On Thu, 25 Apr 2013, Daniel Frey wrote:
2) Given a set of non-constexpr overloads, could the user add even more overloads for constexpr and what is required for this to work? Example:
struct X : private df::commutative_addable< X > { X& operator+=( const X& ); };
constexpr X operator+( constexpr X lhs, constexpr X rhs ) {…}
is the above possible? Are there problems/conflicts? What are the requirements for the non-constexpr overloads and the signature/requirements for the user-defined constexpr-overload to play together nicely?
That's not how constexpr works, there is no overloading on whether the arguments are constexpr.
Oh, OK. I guess that kills constexpr for Boost.Operators in C++11 :-/ Thanks, Daniel