Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10096/boost-sandbox/boost/units
Modified Files:
quantity.hpp
Log Message:
Made constructor explicit when BOOST_NO_SFINAE is defined
Index: quantity.hpp
===================================================================
RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/quantity.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- quantity.hpp 29 Mar 2007 18:18:14 -0000 1.4
+++ quantity.hpp 29 Mar 2007 18:24:44 -0000 1.5
@@ -102,13 +102,13 @@
#else
- /// without SFINAE we can't distinguish between explicit and implicit conversions
+ /// without SFINAE we can't distinguish between explicit and implicit conversions so
+ /// the conversion is always explicit
template<class System2,class Dim2,class YY>
- quantity(const quantity<unit<Dim2,System2>,YY>& source)
+ explicit quantity(const quantity<unit<Dim2,System2>,YY>& source)
: val_(conversion_helper<quantity<unit<Dim2,System2>,YY>,this_type>::convert(source).value())
{
BOOST_STATIC_ASSERT((boost::is_convertible<YY, Y>::value == true));
- BOOST_STATIC_ASSERT((is_implicitly_convertible<unit<Dim2,System2>,unit<Dim,System> >::value == true));
}
#endif
|