Template Class var

Class Documentation

template<typename T>
class util::var

A wrapper for strongly typed variables.

This class can be used to wrap a basic data type in C++ to get string typing through named types. The named types can only be constructed explicitly and used as parameters for functions to avoid ambiguity errors.

    using height = util::var<unsigned long long>;
    height h;
tparam T

the type of the contained value

Public Functions

explicit var(T &&value) noexcept
explicit var(const T &value) noexcept
var() noexcept = default
~var() = default
var(var&&) noexcept = default
var(const var&) noexcept = default
auto operator=(var&&) noexcept -> var& = default
auto operator=(const var&) noexcept -> var& = default
explicit operator T&() noexcept
explicit operator const T&() const noexcept
auto get() noexcept -> T&
auto get() const noexcept -> const T&