
"Joel de Guzman" <joel@boost-consulting.com> wrote in message news:403D6083.6070206@boost-consulting.com...
If you want a newer technology, there's one in the boost-sandbox. See: boost/utility/type_deduction.hpp and a test program: libs/utility/type_deduction_tests.cpp.
Joel, thanks for posting the direct URLs, as I don't have access to sandbox. I tried it out - works like a charm, and compiles much faster than BLL (well, obviously....). FWIW, here's what the "universal operator+" becomes then: template< typename T1, typename T2, template< typename _ > class DAT > inline typename boost::disable_if_c< do_not< promote_sum< DAT > >::value, DAT< typename boost::result_of_plus<T1,T2>::type >
::type operator+( const DAT<T1>& a, const DAT<T2>& b ) { typedef DAT< typename boost::result_of_plus<T1,T2>::type > T; return T( a ) + T( b ); }
(promote_sum<> and do_not<> stay unchanged). ...Max...