cesium-native 0.62.0
Loading...
Searching...
No Matches
CesiumGltf::MetadataConversions< TTo, TFrom, std::enable_if_t< CesiumGltf::IsMetadataInteger< TTo >::value &&CesiumGltf::IsMetadataFloating< TFrom >::value > > Struct Template Reference

Converts from a floating-point type to an integer. More...

#include <CesiumGltf/MetadataConversions.h>

Static Public Member Functions

static std::optional< TTo > convert (TFrom from)
 Converts a floating-point value to an integer type. This truncates the floating-point value, rounding it towards zero.
 
static std::optional< TTo > convert (TFrom)
 Converts between TFrom and TTo where no actual conversion is defined, returning std::nullopt.
 

Detailed Description

template<typename TTo, typename TFrom>
struct CesiumGltf::MetadataConversions< TTo, TFrom, std::enable_if_t< CesiumGltf::IsMetadataInteger< TTo >::value &&CesiumGltf::IsMetadataFloating< TFrom >::value > >

Converts from a floating-point type to an integer.

Definition at line 156 of file MetadataConversions.h.

Member Function Documentation

◆ convert() [1/2]

template<typename TTo, typename TFrom>
static std::optional< TTo > CesiumGltf::MetadataConversions< TTo, TFrom, std::enable_if_t< CesiumGltf::IsMetadataInteger< TTo >::value &&CesiumGltf::IsMetadataFloating< TFrom >::value > >::convert ( TFrom from)
inlinestatic

Converts a floating-point value to an integer type. This truncates the floating-point value, rounding it towards zero.

If the value is outside the range of the integer type, std::nullopt is returned.

Parameters
fromThe floating-point value to convert from.

Definition at line 171 of file MetadataConversions.h.

◆ convert() [2/2]

static std::optional< TTo > CesiumGltf::MetadataConversions< TTo, TFrom, std::enable_if_t< CesiumGltf::IsMetadataInteger< TTo >::value &&CesiumGltf::IsMetadataFloating< TFrom >::value > >::convert ( TFrom )
inlinestatic

Converts between TFrom and TTo where no actual conversion is defined, returning std::nullopt.

Definition at line 26 of file MetadataConversions.h.


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