MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
mtcore::units Namespace Reference

Base namespace for units. More...

Namespaces

namespace  angle
 
namespace  area
 
namespace  current
 
namespace  dimensions
 Represents prebuilt dimensions for units.
 
namespace  length
 
namespace  luminosity
 
namespace  mass
 
namespace  storage
 
namespace  substance
 
namespace  temperature
 
namespace  time
 
namespace  volume
 

Classes

struct  Unit
 Represents a single unit of measurement. More...
 
struct  UnitName
 Template for storing unit names. More...
 
struct  Units
 List of units. More...
 
struct  Units< Unit< Id, S, PiPow, Tr, Exp >, Mappings... >
 
struct  Units<>
 
struct  UnitValue
 Represents a value with associated units. More...
 
struct  UnitValue< Underlying, Units< U1, UnitsSub... > >
 Represents a unit value with a specific, non-empty unit list. More...
 
struct  UnitValue< Underlying, Units<> >
 Specialization where units list is empty (basically a "unitless" value) Can be directly cast to a numeric type. More...
 

Concepts

concept  IsUnit
 Concept to check that a type is a unit.
 
concept  IsUnitValue
 Concept to check something is a unit value.
 

Functions

template<std::floating_point Val, typename... Dims>
constexpr UnitValue< Val, Units< Dims... > > operator* (Val lhs, const Units< Dims... > &)
 Multiply a number with units to get a unit value.
 
template<typename... Dims1, typename... Dims2>
constexpr auto operator* (const Units< Dims1... > &, const Units< Dims2... > &)
 Multiply units to combine them.
 
template<typename... Dims1, typename... Dims2>
constexpr auto operator/ (const Units< Dims1... > &, const Units< Dims2... > &)
 Divide units to combine them.
 
template<std::floating_point Val, typename... Dims>
constexpr auto operator/ (Val lhs, const Units< Dims... > &)
 Divide units with a number to get a unit value.
 
template<typename U1, typename Us1, typename U2, typename Us2>
constexpr auto operator* (const UnitValue< U1, Us1 > &lhs, const UnitValue< U2, Us2 > &rhs)
 Multiply unit values together.
 
template<typename U1, typename Us1, typename U2, typename Us2>
constexpr auto operator/ (const UnitValue< U1, Us1 > &lhs, const UnitValue< U2, Us2 > &rhs)
 Divide unit values.
 
template<std::floating_point I, typename U, typename Us>
constexpr auto operator/ (I value, UnitValue< U, Us > lhs)
 Divide a number with a unit value.
 
template<std::floating_point I, typename U, typename Us>
constexpr auto operator/ (UnitValue< U, Us > lhs, I value)
 Divide a unit value with a number.
 
template<std::integral I, typename U, typename Us>
constexpr auto operator/ (I value, const UnitValue< U, Us > &lhs)
 Divide a number with a unit value.
 
template<std::floating_point Val, typename U, typename Us>
constexpr UnitValue< U, Us > operator* (const UnitValue< U, Us > &lhs, Val rhs)
 Multiply a unit value with a number.
 
template<std::floating_point Val, typename U, typename Us>
constexpr UnitValue< Val, Us > operator* (Val lhs, const UnitValue< U, Us > &rhs)
 Multiply a unit value with a number.
 
template<typename U, typename Us, typename... Dims>
constexpr auto operator* (UnitValue< U, Us > lhs, const Units< Dims... > &u)
 Multiply a unit value with units to combine them.
 
template<typename U, typename Us, typename... Dims>
constexpr auto operator/ (UnitValue< U, Us > lhs, const Units< Dims... > &u)
 Divide a unit value with units to combine them.
 
 MTCORE_DEF_UNIT_NAME_DIFF_US (length, attometre, attometer, am)
 
 MTCORE_DEF_UNIT_NAME_DIFF_US (length, exametre, exameter, Em)
 
 MTCORE_DEF_UNIT_NAME_NO_ABBREV (length, twip)
 
 MTCORE_DEF_UNIT_NAME (length, thou, th)
 
 MTCORE_DEF_UNIT_NAME_NO_ABBREV (length, barleycorn)
 
 MTCORE_DEF_UNIT_NAME_SYM (length, inch, in, "″")
 
 MTCORE_DEF_UNIT_NAME (length, hand, hh)
 
 MTCORE_DEF_UNIT_NAME_SYM (length, foot, in, "′")
 
 MTCORE_DEF_UNIT_NAME (length, yard, yd)
 
 MTCORE_DEF_UNIT_NAME (length, chain, ch)
 
 MTCORE_DEF_UNIT_NAME (length, furlong, fur)
 
 MTCORE_DEF_UNIT_NAME (length, mile, mi)
 
 MTCORE_DEF_UNIT_NAME (length, league, lea)
 
 MTCORE_DEF_UNIT_NAME (length, fathom, ftm)
 
 MTCORE_DEF_UNIT_NAME_NO_ABBREV (length, cable)
 
 MTCORE_DEF_UNIT_NAME (length, nautical_mile, "nmi")
 
 MTCORE_DEF_UNIT_NAME_NO_ABBREV (length, link)
 
 MTCORE_DEF_UNIT_NAME_NO_ABBREV (length, rod)
 
 MTCORE_DEF_UNIT_NAME_NO_ABBREV (area, perch)
 
 MTCORE_DEF_UNIT_NAME_NO_ABBREV (area, rood)
 
 MTCORE_DEF_UNIT_NAME_NO_ABBREV (area, acre)
 
 MTCORE_DEF_UNIT_NAME (area, square_mile, sq mi)
 
 MTCORE_DEF_UNIT_NAME_SI (volume, litre, liter, L)
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, fluid::us_gal, "US gallon", "gallon", "US gal", "US gal", "gal", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, fluid::us_pot, "US pot", "pot", "US pot", "US pot", "pot", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, fluid::us_quart, "US quart", "quart", "US qt", "US qt", "qt", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, fluid::us_pint, "US pint", "pint", "US pt", "US pt", "pt", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, fluid::us_cup, "US cup", "cup", "US c", "US c", "c", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, fluid::us_gill, "US gill", "gill", "US gi", "US gi", "gi", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, fluid::us_jig, "US jig", "jig", "US jig", "US jig", "jig", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, fluid::us_fluid_ounce, "US fluid ounce", "fluid ounce", "US fl oz", "US fl oz", "fl oz", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, fluid::us_tablespoon, "US tablespoon", "tablespoon", "US tbsp", "US tbsp", "tbsp", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, fluid::us_teaspoon, "US teaspoon", "teaspoon", "US tsp", "US tsp", "tsp", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, fluid::us_barrel, "US barrel (liquid)", "barrel (liquid)", "US bbl", "US bbl", "bbl", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, fluid::us_oil_barrel, "US oil barrel", "oil barrel", "US bbl", "US bbl", "bbl", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, fluid::us_hogshead, "US hogshead", "hogshead", "US hogshead", "US hogshead", "hogshead", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, cubic_inch, "cubic inch", "cubic inch", "cu in", "cu in", "cu in", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, cubic_foot, "cubic foot", "cubic foot", "cu ft", "cu ft", "cu ft", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, cubic_yard, "cubic yard", "cubic yard", "cu yd", "cu yd", "cu yd", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (volume, acre_foot, "acre-foot", "acre-foot", "acre-ft", "acre-ft", "acre-ft", "")
 
 MTCORE_DEF_UNIT_NAME_STRS (mass, hundredweight, "US (short) hundredweight", "hundredweight", "US cwt", "US cwt", "cwt", "") MTCORE_DEF_UNIT_NAME_STRS(mass
 
 MTCORE_DEF_UNIT_NAME_DIFF_US (time, attosecond, attosecond, as)
 
 MTCORE_DEF_UNIT_NAME_DIFF_US (time, exasecond, exasecond, Es)
 

Variables

 long_hundredweight
 
long hundredweight
 
long long long cwt
 

Detailed Description

Base namespace for units.

Function Documentation

◆ MTCORE_DEF_UNIT_NAME() [1/10]

mtcore::units::MTCORE_DEF_UNIT_NAME ( area ,
square_mile ,
sq mi )

◆ MTCORE_DEF_UNIT_NAME() [2/10]

mtcore::units::MTCORE_DEF_UNIT_NAME ( length ,
chain ,
ch  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME() [3/10]

mtcore::units::MTCORE_DEF_UNIT_NAME ( length ,
fathom ,
ftm  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME() [4/10]

mtcore::units::MTCORE_DEF_UNIT_NAME ( length ,
furlong ,
fur  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME() [5/10]

mtcore::units::MTCORE_DEF_UNIT_NAME ( length ,
hand ,
hh  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME() [6/10]

mtcore::units::MTCORE_DEF_UNIT_NAME ( length ,
league ,
lea  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME() [7/10]

mtcore::units::MTCORE_DEF_UNIT_NAME ( length ,
mile ,
mi  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME() [8/10]

mtcore::units::MTCORE_DEF_UNIT_NAME ( length ,
nautical_mile ,
"nmi"  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME() [9/10]

mtcore::units::MTCORE_DEF_UNIT_NAME ( length ,
thou ,
th  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MTCORE_DEF_UNIT_NAME() [10/10]

mtcore::units::MTCORE_DEF_UNIT_NAME ( length ,
yard ,
yd  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME_DIFF_US() [1/4]

mtcore::units::MTCORE_DEF_UNIT_NAME_DIFF_US ( length ,
attometre ,
attometer ,
am  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MTCORE_DEF_UNIT_NAME_DIFF_US() [2/4]

mtcore::units::MTCORE_DEF_UNIT_NAME_DIFF_US ( length ,
exametre ,
exameter ,
Em  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME_DIFF_US() [3/4]

mtcore::units::MTCORE_DEF_UNIT_NAME_DIFF_US ( time ,
attosecond ,
attosecond ,
as  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME_DIFF_US() [4/4]

mtcore::units::MTCORE_DEF_UNIT_NAME_DIFF_US ( time ,
exasecond ,
exasecond ,
Es  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME_NO_ABBREV() [1/8]

mtcore::units::MTCORE_DEF_UNIT_NAME_NO_ABBREV ( area ,
acre  )

◆ MTCORE_DEF_UNIT_NAME_NO_ABBREV() [2/8]

mtcore::units::MTCORE_DEF_UNIT_NAME_NO_ABBREV ( area ,
perch  )

◆ MTCORE_DEF_UNIT_NAME_NO_ABBREV() [3/8]

mtcore::units::MTCORE_DEF_UNIT_NAME_NO_ABBREV ( area ,
rood  )

◆ MTCORE_DEF_UNIT_NAME_NO_ABBREV() [4/8]

mtcore::units::MTCORE_DEF_UNIT_NAME_NO_ABBREV ( length ,
barleycorn  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME_NO_ABBREV() [5/8]

mtcore::units::MTCORE_DEF_UNIT_NAME_NO_ABBREV ( length ,
cable  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME_NO_ABBREV() [6/8]

mtcore::units::MTCORE_DEF_UNIT_NAME_NO_ABBREV ( length ,
link  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME_NO_ABBREV() [7/8]

mtcore::units::MTCORE_DEF_UNIT_NAME_NO_ABBREV ( length ,
rod  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME_NO_ABBREV() [8/8]

mtcore::units::MTCORE_DEF_UNIT_NAME_NO_ABBREV ( length ,
twip  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MTCORE_DEF_UNIT_NAME_SI()

mtcore::units::MTCORE_DEF_UNIT_NAME_SI ( volume ,
litre ,
liter ,
L  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [1/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( mass ,
hundredweight ,
"US (short) hundredweight" ,
"hundredweight" ,
"US cwt" ,
"US cwt" ,
"cwt" ,
""  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME_STRS() [2/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
acre_foot ,
"acre-foot" ,
"acre-foot" ,
"acre-ft" ,
"acre-ft" ,
"acre-ft" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [3/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
cubic_foot ,
"cubic foot" ,
"cubic foot" ,
"cu ft" ,
"cu ft" ,
"cu ft" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [4/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
cubic_inch ,
"cubic inch" ,
"cubic inch" ,
"cu in" ,
"cu in" ,
"cu in" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [5/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
cubic_yard ,
"cubic yard" ,
"cubic yard" ,
"cu yd" ,
"cu yd" ,
"cu yd" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [6/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
fluid::us_barrel ,
"US barrel (liquid)" ,
"barrel (liquid)" ,
"US bbl" ,
"US bbl" ,
"bbl" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [7/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
fluid::us_cup ,
"US cup" ,
"cup" ,
"US c" ,
"US c" ,
"c" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [8/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
fluid::us_fluid_ounce ,
"US fluid ounce" ,
"fluid ounce" ,
"US fl oz" ,
"US fl oz" ,
"fl oz" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [9/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
fluid::us_gal ,
"US gallon" ,
"gallon" ,
"US gal" ,
"US gal" ,
"gal" ,
""  )
Here is the caller graph for this function:

◆ MTCORE_DEF_UNIT_NAME_STRS() [10/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
fluid::us_gill ,
"US gill" ,
"gill" ,
"US gi" ,
"US gi" ,
"gi" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [11/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
fluid::us_hogshead ,
"US hogshead" ,
"hogshead" ,
"US hogshead" ,
"US hogshead" ,
"hogshead" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [12/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
fluid::us_jig ,
"US jig" ,
"jig" ,
"US jig" ,
"US jig" ,
"jig" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [13/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
fluid::us_oil_barrel ,
"US oil barrel" ,
"oil barrel" ,
"US bbl" ,
"US bbl" ,
"bbl" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [14/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
fluid::us_pint ,
"US pint" ,
"pint" ,
"US pt" ,
"US pt" ,
"pt" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [15/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
fluid::us_pot ,
"US pot" ,
"pot" ,
"US pot" ,
"US pot" ,
"pot" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [16/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
fluid::us_quart ,
"US quart" ,
"quart" ,
"US qt" ,
"US qt" ,
"qt" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [17/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
fluid::us_tablespoon ,
"US tablespoon" ,
"tablespoon" ,
"US tbsp" ,
"US tbsp" ,
"tbsp" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_STRS() [18/18]

mtcore::units::MTCORE_DEF_UNIT_NAME_STRS ( volume ,
fluid::us_teaspoon ,
"US teaspoon" ,
"teaspoon" ,
"US tsp" ,
"US tsp" ,
"tsp" ,
""  )

◆ MTCORE_DEF_UNIT_NAME_SYM() [1/2]

mtcore::units::MTCORE_DEF_UNIT_NAME_SYM ( length ,
foot ,
in ,
"′"  )
Here is the call graph for this function:

◆ MTCORE_DEF_UNIT_NAME_SYM() [2/2]

mtcore::units::MTCORE_DEF_UNIT_NAME_SYM ( length ,
inch ,
in ,
"″"  )
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ cwt

long long long long long mtcore::units::cwt

Definition at line 76 of file mass.hpp.

◆ hundredweight

long long mtcore::units::hundredweight

Definition at line 76 of file mass.hpp.

◆ long_hundredweight

mtcore::units::long_hundredweight

Definition at line 76 of file mass.hpp.