Skip to content

Struct zmbt::decor::precise

template <class VT>

ClassList > zmbt > decor > precise

Type decorator for floating point numbers. Throws on precision loss in runtime. More...

  • #include <precise_real.hpp>

Public Types

Type Name
typedef VT decorated_type
The decorated type.

Public Functions

Type Name
operator decorated_type () const
bool operator< (precise other) const
bool operator< (boost::json::string_view str) const
precise & operator= (precise const &) = default
precise & operator= (precise &&) = default
precise & operator= (T const v)
precise & operator= (precise< T > other)
precise & operator= (boost::json::string_view str)
bool operator== (precise other) const
bool operator== (boost::json::string_view str) const
precise ()
precise (precise const &) = default
precise (precise &&) = default
precise (decorated_type v)
precise (T const v)
precise (precise< T > other)
precise (boost::json::string_view str)
Construct value from string. Hex literals are supported.
std::string stringify () const
decorated_type value () const
~precise () = default

Detailed Description

The class will ensure exact value conversion between floating point types of different precision on construction and assignment. In addition to handling the f23 vs f63, this class also can be constructed from string literals, enabling support for hex representation.

Public Types Documentation

typedef decorated_type

The decorated type.

using zmbt::decor::precise< VT >::decorated_type =  VT;


Public Functions Documentation

function operator decorated_type

inline zmbt::decor::precise::operator decorated_type () const

function operator<

inline bool zmbt::decor::precise::operator< (
    precise other
) const

function operator<

inline bool zmbt::decor::precise::operator< (
    boost::json::string_view str
) const

function operator=

precise & zmbt::decor::precise::operator= (
    precise const &
) = default

function operator=

precise & zmbt::decor::precise::operator= (
    precise &&
) = default

function operator=

template<class T, class>
inline precise & zmbt::decor::precise::operator= (
    T const v
) 

function operator=

template<class T>
inline precise & zmbt::decor::precise::operator= (
    precise < T > other
) 

function operator=

inline precise & zmbt::decor::precise::operator= (
    boost::json::string_view str
) 

function operator==

inline bool zmbt::decor::precise::operator== (
    precise other
) const

function operator==

inline bool zmbt::decor::precise::operator== (
    boost::json::string_view str
) const

function precise [1/7]

inline zmbt::decor::precise::precise () 

function precise [2/7]

zmbt::decor::precise::precise (
    precise const &
) = default

function precise [3/7]

zmbt::decor::precise::precise (
    precise &&
) = default

function precise [4/7]

inline explicit zmbt::decor::precise::precise (
    decorated_type v
) 

function precise [5/7]

template<class T, class>
inline zmbt::decor::precise::precise (
    T const v
) 

function precise [6/7]

template<class T>
inline zmbt::decor::precise::precise (
    precise < T > other
) 

function precise [7/7]

Construct value from string. Hex literals are supported.

inline zmbt::decor::precise::precise (
    boost::json::string_view str
) 


function stringify

inline std::string zmbt::decor::precise::stringify () const

function value

inline decorated_type zmbt::decor::precise::value () const

function ~precise

zmbt::decor::precise::~precise () = default


The documentation for this class was generated from the following file zmbt-framework/zmbt-framework/backends/cxx/include/zmbt/decor/precise_real.hpp