АХ
Size: a a a
АХ
АХ
АХ
АХ
RN
RN
RN
RN
RN
АХ
АХ
АХ
RN
// Quantity / Quantity
template< int ...Args1, int ...Args2>
const Quantity<IntList<(Args1 - Args2)...>>
operator/(const Quantity<IntList<Args1...>>& lhs,
const Quantity<IntList<Args2...>>& rhs)
{
using ResList = typename Zip<IntList<Args1...>, IntList<Args2...>, Minus>::type;
using ResType = Quantity<ResList>;
return ResType(lhs.value() / rhs.value());
}
// double / Quantity
template<int ...Args>
const Quantity <IntList<Args...>> operator/(double lhs,
const Quantity <IntList<Args...>>& rhs)
{
using NumberQ = Quantity<Dimension<>>;
return (NumberQ / rhs)*lhs;
}
NumberQ / rhs
АХ
// double / Quantity
template<int ...Args>
const Quantity <IntList<Args...>> operator/(double lhs,
const Quantity <IntList<Args...>>& rhs)
{
using ResList = typename Zip<Dimension<>, IntList<Args...>, Minus>::type;
using ResType = Quantity<ResList>;
return ResType (lhs/rhs.value());
}``
АХ
RN
// double / Quantity
template<int ...Args>
const Quantity <IntList<Args...>> operator/(double lhs,
const Quantity <IntList<Args...>>& rhs)
{
using ResList = typename Zip<Dimension<>, IntList<Args...>, Minus>::type;
using ResType = Quantity<ResList>;
return ResType (lhs/rhs.value());
}``