Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
dim::Value< Dimension > Class Template Reference

Value type, dependend from dimensions. More...

#include <C:/Trend/Development/Trax3/Code/dim/DimensionedValues.h>

Inheritance diagram for dim::Value< Dimension >:

Public Types

typedef Real real_type

Public Member Functions

constexpr Real Units () const noexcept
constexpr operator Real () const noexcept
 Explicit conversion to Real for static_cast<Real> and operator (Real).
constexpr operator bool () const noexcept
 Explicit conversion to bool for logical expressions like if( !value ) etc.
Construction

Constructors declared explicit to prevent silent conversions

constexpr Value (const float units) noexcept
constexpr Value (const double units) noexcept
constexpr Value (const int units) noexcept

Detailed Description

template<typename Dimension>
class dim::Value< Dimension >

Value type, dependend from dimensions.

Member Function Documentation

◆ operator Real()

template<typename Dimension>
dim::Value< Dimension >::operator Real ( ) const
inlineexplicitconstexprnoexcept

Explicit conversion to Real for static_cast<Real> and operator (Real).

This operator is provided mainly for internal type conversion to the underlying physics engine (which clearly uses the same units as trax) and in some template metaprogramming situations; you should not use it elsewhere. Try _xy(Value) instead if you know the expected unit xy; at least use Value::Units() but be aware that the library can change the units it actually uses. Uncomment the deprecated clause to get compile time messages.

◆ Units()

template<typename Dimension>
Real dim::Value< Dimension >::Units ( ) const
inlineconstexprnoexcept

For internal use only. Try _X() to get a Real number in units of 'X'.

Returns
the value as used with internal units.

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