26 namespace astrotypes {
29 template<
class BoostUnit>
30 struct boost_unit_to_std_ratio {
31 static_assert(std::is_same<BoostUnit, BoostUnit>::value,
"Unkown conversion from boost unit to std::ratio");
36 typedef std::ratio<86400, 1>
type;
41 typedef std::ratio<1,1>
type;
64 template<
typename BoostType,
typename ChronoType>
65 struct has_equivalent_unit :
public std::is_same<typename boost_unit_to_std_ratio<typename BoostType::unit_type>::type
66 , typename ChronoType::period>::type
70 template<
typename BoostUnit,
typename BoostUnit2,
typename NumT,
typename Num2T>
72 boost::units::quantity<BoostUnit2, Num2T>> :
public std::is_same<NumT, Num2T>::type
76 template<
typename BoostType,
typename ChronoType>
77 struct has_equivalent_rep :
public std::is_same<typename BoostType::value_type, typename ChronoType::rep>::type
81 template<
typename BoostUnit,
typename BoostUnit2,
typename NumT,
typename Num2T>
83 boost::units::quantity<BoostUnit2, Num2T>> :
public std::is_same<BoostUnit, BoostUnit2>::type
87 template<
typename BoostType,
typename ChronoType>
88 struct is_equivalent :
public std::conditional<has_equivalent_unit<BoostType, ChronoType>::value
89 && has_equivalent_rep<BoostType, ChronoType>::value
90 , std::true_type, std::false_type
boost::units::make_scaled_unit< boost::units::si::time, boost::units::scale< 10, boost::units::static_rational<-3 >>>::type MilliSecond
boost::units::make_scaled_unit< boost::units::si::time, boost::units::scale< 10, boost::units::static_rational<-12 >>>::type PicoSecond
boost::units::make_scaled_unit< boost::units::si::time, boost::units::scale< 10, boost::units::static_rational<-9 >>>::type NanoSecond
std::ratio< 86400, 1 > type
conversion helper from boost time units to the std::chrono::duration::period equivalent ...
determine is the NumericalRep of the chrono::duration and the boost::quatity are equivalent ...
determine is the units of the chrono::duration and the boost::quatity are equivalent ...
boost::units::make_scaled_unit< boost::units::si::time, boost::units::scale< 10, boost::units::static_rational<-6 >>>::type MicroSecond
boost::units::si::time Second
determine is the boost::quanity and the std::chrono:;duration are equivalent reperesentations i...
boost::units::make_scaled_unit< boost::units::si::time, boost::units::scale< 86400, boost::units::static_rational< 1 >>>::type Day