58 template<
typename UnderlyingType,
typename Unit>
61 template<
typename Clock,
typename Duration>
83 : m_min{ std::move(
min) }
85 m_min <=
max ?
max : throw std::invalid_argument{
"Range is expected to have min <= max" }) }
89 constexpr const T &
min()
const
95 constexpr const T &
max()
const
107 return value >= m_min && value <= m_max;
113 return m_min == other.m_min && m_max == other.m_max;
125 using Zivid::Detail::operator<<;
126 std::ostringstream stream;
127 stream <<
"{ " << m_min <<
", " << m_max <<
" }";
128 return std::move(stream).str();
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
Class describing a range of values for a given type T.
Definition Range.h:73
constexpr const T & min() const
Get the minimum value of the range.
Definition Range.h:89
bool operator!=(const Range< T > &other) const
Comparison operator.
Definition Range.h:117
constexpr Range(T min, T max)
Constructor.
Definition Range.h:82
constexpr bool isInRange(const T &value) const
Check if the value is in range.
Definition Range.h:105
bool operator==(const Range< T > &other) const
Comparison operator.
Definition Range.h:111
std::string toString() const
Get the range as string.
Definition Range.h:123
T Type
Underlying type.
Definition Range.h:76
constexpr const T & max() const
Get the maximum value of the range.
Definition Range.h:95
constexpr Range()=default
Default constructor.
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:56
std::ostream & operator<<(std::ostream &stream, const Array2D< T > &array)
Serialize array information to a stream.
Definition Array2D.h:285