|
From: Steven W. <ste...@us...> - 2007-04-13 01:05:28
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18753/boost-sandbox/boost/units Modified Files: operators.hpp static_rational.hpp dimension.hpp dim.hpp Log Message: remove static_* Index: operators.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/operators.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- operators.hpp 3 Apr 2007 20:54:15 -0000 1.3 +++ operators.hpp 13 Apr 2007 01:05:28 -0000 1.4 @@ -15,38 +15,9 @@ #include <complex> #include <boost/static_assert.hpp> -#include <boost/version.hpp> #include <boost/type_traits/is_same.hpp> -#if (BOOST_VERSION >= 103400) - #define BOOST_UNITS_HAS_BOOST_TYPEOF 1 -#else - #define BOOST_UNITS_HAS_BOOST_TYPEOF 0 -#endif - -// uncomment this to test without Boost Typeof -//#undef BOOST_UNITS_HAS_BOOST_TYPEOF -//#define BOOST_UNITS_HAS_BOOST_TYPEOF 0 - -#if (BOOST_UNITS_HAS_BOOST_TYPEOF) - #include <boost/typeof/typeof.hpp> - #include <boost/typeof/std/complex.hpp> - #define BOOST_UNITS_HAS_TYPEOF 1 -#else - #if (__GNUC__ && __cplusplus && __GNUC__ >= 3) - #define BOOST_UNITS_HAS_TYPEOF 1 - #define BOOST_UNITS_HAS_GNU_TYPEOF 1 - #elif defined(__MWERKS__) - #define BOOST_UNITS_HAS_TYPEOF 1 - #define BOOST_UNITS_HAS_MWERKS_TYPEOF 1 - #else - #define BOOST_UNITS_HAS_TYPEOF 0 - #endif -#endif - -// uncomment this to test without typeof support at all -//#undef BOOST_UNITS_HAS_TYPEOF -//#define BOOST_UNITS_HAS_TYPEOF 0 +#include <boost/units/config.hpp> /// \file /// \brief Compile time operators and typeof helper classes. @@ -59,28 +30,7 @@ namespace boost { -namespace units { - -/// Compile time negate. -template<typename R> struct static_negate; - -/// Compile time add. -template<typename R1,typename R2> struct static_add; - -/// Compile time subtract. -template<typename R1,typename R2> struct static_subtract; - -/// Compile time multiply. -template<typename R1,typename R2> struct static_multiply; - -/// Compile time divide. -template<typename R1,typename R2> struct static_divide; - -/// Compile time power. -template<typename R1,typename R2> struct static_power; - -/// Compile time root. -template<typename R1,typename R2> struct static_root; +namespace units { #if BOOST_UNITS_HAS_TYPEOF @@ -151,14 +101,6 @@ #endif -//template<typename X> struct unary_plus_typeof_helper { typedef typeof(+X()) type; }; -//template<typename X> struct unary_minus_typeof_helper { typedef typeof(-X()) type; }; -// -//template<typename X,typename Y> struct add_typeof_helper { typedef typeof(X()+Y()) type; }; -//template<typename X,typename Y> struct subtract_typeof_helper { typedef typeof(X()-Y()) type; }; -//template<typename X,typename Y> struct multiply_typeof_helper { typedef typeof(X()*Y()) type; }; -//template<typename X,typename Y> struct divide_typeof_helper { typedef typeof(X()/Y()) type; }; - #else // BOOST_UNITS_HAS_TYPEOF template<typename X> struct unary_plus_typeof_helper { typedef X type; }; Index: static_rational.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/static_rational.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- static_rational.hpp 12 Apr 2007 00:39:12 -0000 1.5 +++ static_rational.hpp 13 Apr 2007 01:05:28 -0000 1.6 @@ -126,45 +126,6 @@ return T(N)/T(D); } -///// negate @c static_rational -//template<integer_type N,integer_type D> -//struct static_negate< static_rational<N,D> > -//{ -// typedef typename static_rational<-N,D>::type type; -//}; -// -///// add @c static_rational -//template<integer_type N1,integer_type D1, -// integer_type N2,integer_type D2> -//struct static_add< static_rational<N1,D1>,static_rational<N2,D2> > -//{ -// typedef typename static_rational<N1*D2+N2*D1,D1*D2>::type type; -//}; -// -///// subtract @c static_rational -//template<integer_type N1,integer_type D1, -// integer_type N2,integer_type D2> -//struct static_subtract< static_rational<N1,D1>,static_rational<N2,D2> > -//{ -// typedef typename static_rational<N1*D2-N2*D1,D1*D2>::type type; -//}; -// -///// multiply @c static_rational -//template<integer_type N1,integer_type D1, -// integer_type N2,integer_type D2> -//struct static_multiply< static_rational<N1,D1>,static_rational<N2,D2> > -//{ -// typedef typename static_rational<N1*N2,D1*D2>::type type; -//}; -// -///// divide @c static_rational -//template<integer_type N1,integer_type D1, -// integer_type N2,integer_type D2> -//struct static_divide< static_rational<N1,D1>,static_rational<N2,D2> > -//{ -// typedef typename static_rational<N1*D2,D1*N2>::type type; -//}; - /// raise @c int to a @c static_rational power template<long N,long D> struct power_typeof_helper<int,static_rational<N,D> > Index: dimension.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/dimension.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- dimension.hpp 12 Apr 2007 20:44:46 -0000 1.6 +++ dimension.hpp 13 Apr 2007 01:05:28 -0000 1.7 @@ -73,55 +73,6 @@ public mpl::true_ { }; -//// All the static_* metafunctions in this file assume -//// that their parameters are sorted dimension lists. -//// -//// should we static assert is_dimension_list here? -// -///// Negate dimension list. -//template<typename DL> -//struct static_negate -//{ -// typedef DL type; -//}; -// -///// Add two dimension list, only permitted if they are commensurate. -//template<typename DL1,typename DL2> -//struct static_add -//{ -// BOOST_STATIC_ASSERT((is_same<DL1,DL2>::value == true)); -// typedef DL1 type; -//}; -// -///// Subtract two dimension sequences, only permitted if they are commensurate. -//template<typename DL1,typename DL2> -//struct static_subtract -//{ -// BOOST_STATIC_ASSERT((is_same<DL1,DL2>::value == true)); -// typedef DL2 type; -//}; -// -///// Multiply two dimension sequences. -//template<typename DL1,typename DL2> -//struct static_multiply -//{ -// typedef typename detail::merge_dimensions<DL1,DL2>::type type; -//}; -// -///// Divide two dimension lists. -//template<typename DL1,typename DL2> -//struct static_divide -//{ -// typedef typename detail::merge_dimensions< -// DL1, -// typename detail::static_inverse_impl< -// mpl::size<DL2>::value -// >::template apply< -// typename mpl::begin<DL2>::type -// >::type -// >::type type; -//}; - /// Raise a dimension list to a scalar power. template<typename DL,typename Ex> struct static_power Index: dim.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/dim.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- dim.hpp 12 Apr 2007 00:39:12 -0000 1.2 +++ dim.hpp 13 Apr 2007 01:05:28 -0000 1.3 @@ -54,82 +54,6 @@ public mpl::true_ { }; -///// \brief Negate a @c dim. -///// -///// \detailed @c static_negate operation delegates to @c value_type. -//template<typename T,typename V> -//struct static_negate< dim<T,V> > -//{ -// typedef dim<T,typename static_negate<V>::type> type; -//}; -// -///// \brief Add two dims. -///// -///// \detailed -///// @c static_add operations on dim are only defined between dims having identical -///// @c tag_type. Operation delegates to @c value_type. -//template<typename T,typename V1,typename V2> -//struct static_add< dim<T,V1>,dim<T,V2> > -//{ -// typedef dim<T,typename static_add<V1,V2>::type> type; -//}; -// -///// \brief Subtract two dims. -///// -///// \detailed -///// @c static_subtract operations on dim are only defined between dims having identical -///// @c tag_type. Operation delegates to @c value_type. -//template<typename T,typename V1,typename V2> -//struct static_subtract< dim<T,V1>,dim<T,V2> > -//{ -// typedef dim<T,typename static_subtract<V1,V2>::type> type; -//}; -// -///// \brief Multiply a @c dim and a @c value_type. -///// -///// \detailed -///// @c static_multiply operations on @c dim are only defined between @c dim and -///// @c value_type or @c value_type and @c dim. Operation delegates to @c value_type. -//template<typename T,typename V,typename X> -//struct static_multiply< dim<T,V>,X > -//{ -// typedef dim<T,typename static_multiply<V,X>::type> type; -//}; -// -///// \brief Multipy a @c value_type and a @c dim. -///// -///// \detailed -///// @c static_multiply operations on @c dim are only defined between @c dim and -///// @c value_type or @c value_type and @c dim. Operation delegates to @c value_type. -//template<typename T,typename V,typename X> -//struct static_multiply< X,dim<T,V> > -//{ -// typedef dim<T,typename static_multiply<X,V>::type> type; -//}; -// -///// \brief Divide a @c dim by a @c value_type. -///// -///// \detailed -///// @c static_divide operations on dim are only defined between @c dim and @c value_type or -///// @c value_type and @c dim. Operation delegates to @c value_type. -//template<typename T,typename V,typename X> -//struct static_divide< dim<T,V>,X > -//{ -// typedef dim<T,typename static_divide<V,X>::type> type; -//}; -// -///// \brief Divide a @c value_type by a @c dim. -///// -///// \detailed -///// @c static_divide operations on dim are only defined between @c dim and @c value_type or -///// @c value_type and @c dim. Operation delegates to @c value_type, negating to account -///// for the resulting inverse unit tag. -//template<typename T,typename V,typename X> -//struct static_divide< X,dim<T,V> > -//{ -// typedef dim<T,typename static_negate<typename static_divide<X,V>::type>::type> type; -//}; - } // namespace units namespace mpl { |