TypeSI
Units of 'Système international' Blended for C++
|
Generic unit type. More...
#include <si_internal.hpp>
Public Member Functions | |
Unit (const T &value=T()) | |
Explicit constructor from container type. | |
template<typename AnotherT > | |
Unit (const Unit< AnotherT, Powers... > &unit) | |
Implicit constructor from units with same power values but different container type. | |
template<typename AnotherT > | |
operator AnotherT () const | |
Explicit conversion to any type compatible with container(including
other units) | |
T | operator+ () const |
Conversion to container type via unary '+'. | |
template<typename AnotherT > | |
decltype(std::declval< T >()==std::declval< AnotherT >()) | operator== (const Unit< AnotherT, Powers... > &unit) const |
Operator '==' for units with same power values. | |
template<typename AnotherT > | |
decltype(std::declval< T >() !=std::declval< AnotherT >()) | operator!= (const Unit< AnotherT, Powers... > &unit) const |
Operator '!=' for units with same power values. | |
template<typename AnotherT > | |
decltype(std::declval< T >()< std::declval< AnotherT >()) | operator< (const Unit< AnotherT, Powers... > &unit) const |
Operator '<' for units with same power values. | |
template<typename AnotherT > | |
decltype(std::declval< T >()<=std::declval< AnotherT >()) | operator<= (const Unit< AnotherT, Powers... > &unit) const |
Operator '<=' for units with same power values. | |
template<typename AnotherT > | |
decltype(std::declval< T >() > std::declval< AnotherT >()) | operator> (const Unit< AnotherT, Powers... > &unit) const |
Operator '>' for units with same power values. | |
template<typename AnotherT > | |
decltype(std::declval< T >() >=std::declval< AnotherT >()) | operator>= (const Unit< AnotherT, Powers... > &unit) const |
Operator '>=' for units with same power values. | |
template<typename AnotherT > | |
Unit< decltype(std::declval< T >()+std::declval< AnotherT >()), Powers... > | operator+ (const Unit< AnotherT, Powers... > &unit) const |
Operator '+' for units with same power values. | |
Unit & | operator++ () |
Prefix increment. | |
Unit | operator++ (int) |
Postfix increment. | |
template<typename AnotherT > | |
Unit & | operator+= (const Unit< AnotherT, Powers... > &unit) |
Operator '+=' for units with same power values. | |
template<typename AnotherT > | |
Unit< decltype(std::declval< T >() - std::declval< AnotherT >()), Powers... > | operator- (const Unit< AnotherT, Powers... > &unit) const |
Operator '-' for units with same power values. | |
template<typename AnotherT > | |
Unit & | operator-= (const Unit< AnotherT, Powers... > &unit) |
Operator '-=' for units with same power values. | |
Unit & | operator-- () |
Prefix decrement. | |
Unit | operator-- (int) |
Postfix decrement. | |
Unit< decltype(std::declval< T >() *std::declval< T >()), Powers... > | operator* (const T &value) const |
Operator '*' for dimensionless operand of container type. | |
Unit< decltype(std::declval< T >()/std::declval< T >()), Powers... > | operator/ (const T &value) const |
Operator '/' for dimensionless operand of container type. | |
Unit & | operator*= (const T &value) |
Operator '*=' for dimensionless operand of container type. | |
Unit & | operator/= (const T &value) |
Operator '/=' for dimensionless operand of container type. | |
template<typename AnotherT , typename... OtherPowers> | |
Unit< decltype(std::declval< T >() *std::declval< AnotherT >()), std::ratio_add< Powers, OtherPowers > | operator* (const Unit< AnotherT, OtherPowers... > &unit) const |
Operator '*' for any unit. | |
template<typename AnotherT , typename... OtherPowers> | |
Unit< decltype(std::declval< T >()/std::declval< AnotherT >()), std::ratio_subtract< Powers, OtherPowers > | operator/ (const Unit< AnotherT, OtherPowers... > &unit) const |
Operator '/' for any unit. | |
Generic unit type.
T | Any number type such as float, double or long double used as a container |
Powers | Sequence of std::ratio representing powers of base units in SI |