|
rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
|
Owns a copy of a dynamically typed scalar value. More...
#include <rexlib/core/numerical/scalar_value.hpp>
Public Member Functions | |
| template<typename T > | |
| scalar_value (const T &value) noexcept | |
| Construct a new scalar value object holding a copy of the input. | |
| scalar_value (const scalar_value &other)=default | |
| scalar_value (scalar_value &&other)=default | |
| scalar_value & | operator= (const scalar_value &other)=default |
| scalar_value & | operator= (scalar_value &&other)=default |
| template<typename T > | |
| const T & | get () const |
| Type-safe access to the stored value. | |
| template<typename T > | |
| const T * | get_if () const noexcept |
| Type-safe, non-throwing access to the stored value. | |
| numerical_type | get_data_type () const noexcept |
| Get the numerical type of the stored value. | |
Owns a copy of a dynamically typed scalar value.
The scalar value must be representable by one of the numerical_type types. Unlike a reference, this class stores the value in-place, so it does not depend on the lifetime of the object it was constructed from.
Construct a new scalar value object holding a copy of the input.
| T | Type of the value. It must be representable by a numerical_type. |
| value | The value to be copied. |
Type-safe access to the stored value.
| T | Type to be accessed. |
| bad_scalar_value_access | if T does not match the stored type. |
|
noexcept |
Get the numerical type of the stored value.
Type-safe, non-throwing access to the stored value.
| T | Type to be accessed. |