/
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/absolute.hpp
(5540B)
// 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) /// /// \file /// \brief Absolute units (points rather than vectors). /// \details Operations between absolute units, and relative units like temperature differences. /// #ifndef BOOST_UNITS_ABSOLUTE_HPP #define BOOST_UNITS_ABSOLUTE_HPP #include <iosfwd> #include <boost/units/detail/absolute_impl.hpp> namespace boost { namespace units { /// A wrapper to represent absolute units (points rather than vectors). Intended /// originally for temperatures, this class implements operators for absolute units /// so that addition of a relative unit to an absolute unit results in another /// absolute unit : absolute<T> +/- T -> absolute<T> and subtraction of one absolute /// unit from another results in a relative unit : absolute<T> - absolute<T> -> T. template<class Y> class absolute { public: typedef absolute<Y> this_type; typedef Y value_type; BOOST_CONSTEXPR absolute() : val_() { } BOOST_CONSTEXPR absolute(const value_type& val) : val_(val) { } BOOST_CONSTEXPR absolute(const this_type& source) : val_(source.val_) { } BOOST_CXX14_CONSTEXPR this_type& operator=(const this_type& source) { val_ = source.val_; return *this; } BOOST_CONSTEXPR const value_type& value() const { return val_; } BOOST_CXX14_CONSTEXPR const this_type& operator+=(const value_type& val) { val_ += val; return *this; } BOOST_CXX14_CONSTEXPR const this_type& operator-=(const value_type& val) { val_ -= val; return *this; } private: value_type val_; }; /// add a relative value to an absolute one template<class Y> BOOST_CONSTEXPR absolute<Y> operator+(const absolute<Y>& aval,const Y& rval) { return absolute<Y>(aval.value()+rval); } /// add a relative value to an absolute one template<class Y> BOOST_CONSTEXPR absolute<Y> operator+(const Y& rval,const absolute<Y>& aval) { return absolute<Y>(aval.value()+rval); } /// subtract a relative value from an absolute one template<class Y> BOOST_CONSTEXPR absolute<Y> operator-(const absolute<Y>& aval,const Y& rval) { return absolute<Y>(aval.value()-rval); } /// subtracting two absolutes gives a difference template<class Y> BOOST_CONSTEXPR Y operator-(const absolute<Y>& aval1,const absolute<Y>& aval2) { return Y(aval1.value()-aval2.value()); } /// creates a quantity from an absolute unit and a raw value template<class D, class S, class T> BOOST_CONSTEXPR quantity<absolute<unit<D, S> >, T> operator*(const T& t, const absolute<unit<D, S> >&) { return(quantity<absolute<unit<D, S> >, T>::from_value(t)); } /// creates a quantity from an absolute unit and a raw value template<class D, class S, class T> BOOST_CONSTEXPR quantity<absolute<unit<D, S> >, T> operator*(const absolute<unit<D, S> >&, const T& t) { return(quantity<absolute<unit<D, S> >, T>::from_value(t)); } /// Print an absolute unit template<class Char, class Traits, class Y> std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os,const absolute<Y>& aval) { os << "absolute " << aval.value(); return os; } } // namespace units } // namespace boost #if BOOST_UNITS_HAS_BOOST_TYPEOF #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::absolute, (class)) #endif namespace boost { namespace units { /// Macro to define the offset between two absolute units. /// Requires the value to be in the destination units e.g /// @code /// BOOST_UNITS_DEFINE_CONVERSION_OFFSET(celsius_base_unit, fahrenheit_base_unit, double, 32.0); /// @endcode /// @c BOOST_UNITS_DEFINE_CONVERSION_FACTOR is also necessary to /// specify the conversion factor. Like @c BOOST_UNITS_DEFINE_CONVERSION_FACTOR /// this macro defines both forward and reverse conversions so /// defining, e.g., the conversion from celsius to fahrenheit as above will also /// define the inverse conversion from fahrenheit to celsius. #define BOOST_UNITS_DEFINE_CONVERSION_OFFSET(From, To, type_, value_) \ namespace boost { \ namespace units { \ template<> \ struct affine_conversion_helper< \ reduce_unit<From::unit_type>::type, \ reduce_unit<To::unit_type>::type> \ { \ BOOST_STATIC_CONSTEXPR bool is_defined = true; \ typedef type_ type; \ static BOOST_CONSTEXPR type value() { return(value_); } \ }; \ } \ } \ void boost_units_require_semicolon() } // namespace units } // namespace boost #endif // BOOST_UNITS_ABSOLUTE_HPP
Save
cmd:
run