24 #ifndef PSS_ASTROTYPES_UNITS_QUANTITY_H
25 #define PSS_ASTROTYPES_UNITS_QUANTITY_H
27 #pragma GCC diagnostic push
28 #pragma GCC diagnostic ignored "-Wall"
29 #pragma GCC diagnostic ignored "-Wpragmas"
30 #pragma GCC diagnostic ignored "-Wunused-parameter"
31 #pragma GCC diagnostic ignored "-Wunused-variable"
32 #include <boost/units/quantity.hpp>
33 #pragma GCC diagnostic pop
36 namespace astrotypes {
44 template<
typename Unit,
typename NumericalRep,
class Enabled =
void>
45 class Quantity :
public boost::units::quantity<Unit, NumericalRep>
47 typedef boost::units::quantity<Unit, NumericalRep> BaseT;
62 template<
typename UnitType,
typename OtherDataType
63 ,
typename Enable =
typename std::enable_if<!std::is_same<UnitType, Unit>::value,
void>::type>
64 explicit Quantity(boost::units::quantity<UnitType, OtherDataType>
const& o) : BaseT(o) {}
69 template<
typename UnitType,
typename OtherDataType>
72 static_cast<BaseT&
>(*this) = BaseT(o);
77 template<
typename Unit,
typename Rep,
typename Unit2,
typename Rep2>
83 template<
typename Unit,
typename Rep,
typename Unit2,
typename Rep2>
96 template<
typename T1,
typename Unit,
typename X>
97 struct multiply_typeof_helper<T1,
pss::astrotypes::units::Quantity<Unit, X>>
103 template<
typename T1,
typename Unit,
typename X>
104 struct multiply_typeof_helper<
pss::astrotypes::units::Quantity<Unit, X>, T1>
110 template<
typename T1,
typename Unit,
typename X>
111 struct divide_typeof_helper<T1,
pss::astrotypes::units::Quantity<Unit, X>>
117 template<
typename T1,
typename Unit,
typename X>
118 struct divide_typeof_helper<
pss::astrotypes::units::Quantity<Unit, X>, T1>
126 #endif // PSS_ASTROTYPES_UNITS_QUANTITY_H
divide_typeof_helper< T1, quantity< Unit, X > >::type BoostType
multiply_typeof_helper< quantity< Unit, X >, T1 >::type BoostType
pss::astrotypes::units::Quantity< typename BoostType::unit_type, typename BoostType::value_type > type
multiply_typeof_helper< T1, quantity< Unit, X > >::type BoostType
TimePoint< ClockType, Duration > operator+(TimePoint< ClockType, Duration > const &lhs, Duration2 const &rhs)
Quantity(BaseT const &b)
Default empty constructor.
pss::astrotypes::units::Quantity< typename BoostType::unit_type, typename BoostType::value_type > type
TimePoint< ClockType, DurationType > operator-(TimePoint< ClockType, DurationType > const &lhs, boost::units::quantity< boost::units::si::time, Rep > const &rhs)
pss::astrotypes::units::Quantity< typename BoostType::unit_type, typename BoostType::value_type > type
pss::astrotypes::units::Quantity< typename BoostType::unit_type, typename BoostType::value_type > type
divide_typeof_helper< quantity< Unit, X >, T1 >::type BoostType
Quantity(boost::units::quantity< UnitType, OtherDataType > const &o)
instatiate from alternative unit
Quantity & operator=(boost::units::quantity< UnitType, OtherDataType > const &o)
copy ssignment