TypeSI
Units of 'Système international' Blended for C++
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Si::Internal::Unit< T, Powers > Class Template Reference

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)
 
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.
 
Unitoperator++ ()
 Prefix increment.
 
Unit operator++ (int)
 Postfix increment.
 
template<typename AnotherT >
Unitoperator+= (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 >
Unitoperator-= (const Unit< AnotherT, Powers... > &unit)
 Operator '-=' for units with same power values.
 
Unitoperator-- ()
 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.
 
Unitoperator*= (const T &value)
 Operator '*=' for dimensionless operand of container type.
 
Unitoperator/= (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.
 

Detailed Description

template<typename T, typename... Powers>
class Si::Internal::Unit< T, Powers >

Generic unit type.

Template Parameters
TAny number type such as float, double or long double used as a container
PowersSequence of std::ratio representing powers of base units in SI

The documentation for this class was generated from the following file: