
on Mon Apr 23 2012, lcaminiti <lorcaminiti-AT-gmail.com> wrote:
Dave Abrahams wrote
Actually it checks that there exists an operator+ from T non-const lvalue x T non-const lvalue to U, where U is convertible to T const&
Got it. That works for me but I might change the T non-const lvalue to T const&. For curiosity, is there a way to program the concept ruling out the implicit conversion from U to T const&?
Sure; lots of ways. One would be to pass the result to a function like template <class T, class U> void same_type(U const&) { BOOST_MPL_ASSERT((is_same<T,U>)); } You can see another similar example in the first example at http://www.boost.org/doc/libs/1_36_0/libs/concept_check/creating_concepts.ht... -- Dave Abrahams BoostPro Computing http://www.boostpro.com