From: Steven W. <ste...@us...> - 2007-04-15 01:47:06
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32068/boost-sandbox/boost/units Modified Files: base_dimension.hpp Log Message: Put the helper structs in namespace detail Index: base_dimension.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/base_dimension.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- base_dimension.hpp 15 Apr 2007 01:41:48 -0000 1.4 +++ base_dimension.hpp 15 Apr 2007 01:47:05 -0000 1.5 @@ -23,6 +23,8 @@ namespace units { +namespace detail { + typedef char no; struct yes { no dummy[2]; }; @@ -35,6 +37,8 @@ template<> struct ordinal_has_already_been_defined<false> { typedef void type; }; +} + /// this must be in namespace boost::units so that ADL /// will work with friend functions defined inline. /// INTERNAL ONLY @@ -48,7 +52,7 @@ /// we need a mangled name because it must be found by ADL /// INTERNAL ONLY template<class T> -no boost_units_prevent_double_definition(const T&) { return(no()); } +detail::no boost_units_prevent_double_definition(const T&) { return(detail::no()); } /// Defines a base dimensions. To define a dimension you need to provide /// the derived class and a unique integer. @@ -57,13 +61,13 @@ /// to use the same value in multiple definitions. template<class Derived, long N, - class = typename ordinal_has_already_been_defined< - sizeof(boost_units_prevent_double_definition(units::long_<N>())) == sizeof(yes) && - sizeof(boost_units_prevent_double_definition(units::base_dimension_pair<Derived, N>())) != sizeof(yes) + class = typename detail::ordinal_has_already_been_defined< + sizeof(boost_units_prevent_double_definition(units::long_<N>())) == sizeof(detail::yes) && + sizeof(boost_units_prevent_double_definition(units::base_dimension_pair<Derived, N>())) != sizeof(detail::yes) >::type> struct base_dimension : mpl::long_<N> { - friend yes boost_units_prevent_double_definition(const units::long_<N>&) { return(yes()); } - friend yes boost_units_prevent_double_definition(const units::base_dimension_pair<Derived, N>&) { return(yes()); } + friend detail::yes boost_units_prevent_double_definition(const units::long_<N>&) { return(detail::yes()); } + friend detail::yes boost_units_prevent_double_definition(const units::base_dimension_pair<Derived, N>&) { return(detail::yes()); } typedef base_dimension this_type; typedef mpl::long_<N> value; typedef dimension_list<dim<Derived,static_rational<1> >, dimensionless_type> type; |