/
usr
/
include
/
boost
/
units
/
/usr/include/boost/units
mkdir
upload
Name
Size
Mode
Actions
base_units/
-
0755
rm
detail/
-
0755
rm
physical_dimensions/
-
0755
rm
systems/
-
0755
rm
absolute.hpp
5540
0644
edit
dl
rm
base_dimension.hpp
3692
0644
edit
dl
rm
base_unit.hpp
4132
0644
edit
dl
rm
cmath.hpp
20592
0644
edit
dl
rm
config.hpp
2829
0644
edit
dl
rm
conversion.hpp
9518
0644
edit
dl
rm
derived_dimension.hpp
6465
0644
edit
dl
rm
dim.hpp
4745
0644
edit
dl
rm
dimension.hpp
4403
0644
edit
dl
rm
dimensionless_quantity.hpp
995
0644
edit
dl
rm
dimensionless_type.hpp
1315
0644
edit
dl
rm
dimensionless_unit.hpp
957
0644
edit
dl
rm
get_dimension.hpp
1221
0644
edit
dl
rm
get_system.hpp
1165
0644
edit
dl
rm
heterogeneous_system.hpp
12258
0644
edit
dl
rm
homogeneous_system.hpp
2399
0644
edit
dl
rm
io.hpp
32470
0644
edit
dl
rm
is_dim.hpp
885
0644
edit
dl
rm
is_dimensionless.hpp
1107
0644
edit
dl
rm
is_dimensionless_quantity.hpp
936
0644
edit
dl
rm
is_dimensionless_unit.hpp
905
0644
edit
dl
rm
is_dimension_list.hpp
1057
0644
edit
dl
rm
is_quantity.hpp
916
0644
edit
dl
rm
is_quantity_of_dimension.hpp
1115
0644
edit
dl
rm
is_quantity_of_system.hpp
1097
0644
edit
dl
rm
is_unit.hpp
879
0644
edit
dl
rm
is_unit_of_dimension.hpp
1138
0644
edit
dl
rm
is_unit_of_system.hpp
1127
0644
edit
dl
rm
lambda.hpp
26841
0644
edit
dl
rm
limits.hpp
4345
0644
edit
dl
rm
make_scaled_unit.hpp
1817
0644
edit
dl
rm
make_system.hpp
4914
0644
edit
dl
rm
operators.hpp
6287
0644
edit
dl
rm
physical_dimensions.hpp
4532
0644
edit
dl
rm
pow.hpp
3033
0644
edit
dl
rm
quantity.hpp
41860
0644
edit
dl
rm
reduce_unit.hpp
868
0644
edit
dl
rm
scale.hpp
5062
0644
edit
dl
rm
scaled_base_unit.hpp
3643
0644
edit
dl
rm
static_constant.hpp
2425
0644
edit
dl
rm
static_rational.hpp
10435
0644
edit
dl
rm
unit.hpp
13449
0644
edit
dl
rm
units_fwd.hpp
2191
0644
edit
dl
rm
Edit:
/usr/include/boost/units/operators.hpp
(6287B)
// Boost.Units - A C++ library for zero-overhead dimensional analysis and // unit/quantity manipulation and conversion // // Copyright (C) 2003-2008 Matthias Christian Schabel // Copyright (C) 2008 Steven Watanabe // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_UNITS_OPERATORS_HPP #define BOOST_UNITS_OPERATORS_HPP /// /// \file /// \brief Compile time operators and typeof helper classes. /// \details /// These operators declare the compile-time operators needed to support dimensional /// analysis algebra. They require the use of Boost.Typeof, emulation or native. /// Typeof helper classes define result type for heterogeneous operators on value types. /// These must be defined through specialization for powers and roots. /// #include <boost/static_assert.hpp> #include <boost/type_traits/is_same.hpp> #include <boost/units/config.hpp> namespace boost { namespace units { #if BOOST_UNITS_HAS_TYPEOF #ifndef BOOST_UNITS_DOXYGEN // to avoid need for default constructor and eliminate divide by zero errors. namespace typeof_ { /// INTERNAL ONLY template<class T> T make(); } // namespace typeof_ #endif #if (BOOST_UNITS_HAS_BOOST_TYPEOF) template<typename X> struct unary_plus_typeof_helper { BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (+typeof_::make<X>())) typedef typename nested::type type; }; template<typename X> struct unary_minus_typeof_helper { BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (-typeof_::make<X>())) typedef typename nested::type type; }; template<typename X,typename Y> struct add_typeof_helper { BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (typeof_::make<X>()+typeof_::make<Y>())) typedef typename nested::type type; }; template<typename X,typename Y> struct subtract_typeof_helper { BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (typeof_::make<X>()-typeof_::make<Y>())) typedef typename nested::type type; }; template<typename X,typename Y> struct multiply_typeof_helper { BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (typeof_::make<X>()*typeof_::make<Y>())) typedef typename nested::type type; }; template<typename X,typename Y> struct divide_typeof_helper { BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (typeof_::make<X>()/typeof_::make<Y>())) typedef typename nested::type type; }; #elif (BOOST_UNITS_HAS_MWERKS_TYPEOF) template<typename X> struct unary_plus_typeof_helper { typedef __typeof__((+typeof_::make<X>())) type; }; template<typename X> struct unary_minus_typeof_helper { typedef __typeof__((-typeof_::make<X>())) type; }; template<typename X,typename Y> struct add_typeof_helper { typedef __typeof__((typeof_::make<X>()+typeof_::make<Y>())) type; }; template<typename X,typename Y> struct subtract_typeof_helper { typedef __typeof__((typeof_::make<X>()-typeof_::make<Y>())) type; }; template<typename X,typename Y> struct multiply_typeof_helper { typedef __typeof__((typeof_::make<X>()*typeof_::make<Y>())) type; }; template<typename X,typename Y> struct divide_typeof_helper { typedef __typeof__((typeof_::make<X>()/typeof_::make<Y>())) type; }; #elif (BOOST_UNITS_HAS_GNU_TYPEOF) || defined(BOOST_UNITS_DOXYGEN) template<typename X> struct unary_plus_typeof_helper { typedef typeof((+typeof_::make<X>())) type; }; template<typename X> struct unary_minus_typeof_helper { typedef typeof((-typeof_::make<X>())) type; }; template<typename X,typename Y> struct add_typeof_helper { typedef typeof((typeof_::make<X>()+typeof_::make<Y>())) type; }; template<typename X,typename Y> struct subtract_typeof_helper { typedef typeof((typeof_::make<X>()-typeof_::make<Y>())) type; }; template<typename X,typename Y> struct multiply_typeof_helper { typedef typeof((typeof_::make<X>()*typeof_::make<Y>())) type; }; template<typename X,typename Y> struct divide_typeof_helper { typedef typeof((typeof_::make<X>()/typeof_::make<Y>())) type; }; #endif #else // BOOST_UNITS_HAS_TYPEOF template<typename X> struct unary_plus_typeof_helper { typedef X type; }; template<typename X> struct unary_minus_typeof_helper { typedef X type; }; template<typename X,typename Y> struct add_typeof_helper { BOOST_STATIC_ASSERT((is_same<X,Y>::value == true)); typedef X type; }; template<typename X,typename Y> struct subtract_typeof_helper { BOOST_STATIC_ASSERT((is_same<X,Y>::value == true)); typedef X type; }; template<typename X,typename Y> struct multiply_typeof_helper { BOOST_STATIC_ASSERT((is_same<X,Y>::value == true)); typedef X type; }; template<typename X,typename Y> struct divide_typeof_helper { BOOST_STATIC_ASSERT((is_same<X,Y>::value == true)); typedef X type; }; #endif // BOOST_UNITS_HAS_TYPEOF template<typename X,typename Y> struct power_typeof_helper; template<typename X,typename Y> struct root_typeof_helper; #ifdef BOOST_UNITS_DOXYGEN /// A helper used by @c pow to raise /// a runtime object to a compile time /// known exponent. This template is intended to /// be specialized. All specializations must /// conform to the interface shown here. /// @c Exponent will be either the exponent /// passed to @c pow or @c static_rational<N> /// for and integer argument, N. template<typename BaseType, typename Exponent> struct power_typeof_helper { /// specifies the result type typedef detail::unspecified type; /// Carries out the runtime calculation. static BOOST_CONSTEXPR type value(const BaseType& base); }; /// A helper used by @c root to take a root /// of a runtime object using a compile time /// known index. This template is intended to /// be specialized. All specializations must /// conform to the interface shown here. /// @c Index will be either the type /// passed to @c pow or @c static_rational<N> /// for and integer argument, N. template<typename Radicand, typename Index> struct root_typeof_helper { /// specifies the result type typedef detail::unspecified type; /// Carries out the runtime calculation. static BOOST_CONSTEXPR type value(const Radicand& base); }; #endif } // namespace units } // namespace boost #endif // BOOST_UNITS_OPERATORS_HPP
Save
cmd:
run