58 template<
typename UnderlyingType,
typename Unit>
61 std::chrono::duration<UnderlyingType, Unit> value);
63 template<
typename Clock,
typename Duration>
86 min <=
max ?
min : throw std::invalid_argument{
"Range is expected to have min <= max" }) }
87 , m_max{ std::move(
max) }
91 constexpr const T &
min()
const
97 constexpr const T &
max()
const
109 return value >= m_min && value <= m_max;
115 return m_min == other.m_min && m_max == other.m_max;
127 using Zivid::Detail::operator<<;
128 std::ostringstream stream;
129 stream <<
"{ " << m_min <<
", " << m_max <<
" }";
130 return std::move(stream).str();
#define ZIVID_UTILS_EXPORT
Definition UtilsExport.h:56
Class describing a range of values for a given type T.
Definition Range.h:75
constexpr const T & min() const
Get the minimum value of the range.
Definition Range.h:91
bool operator!=(const Range< T > &other) const
Comparison operator.
Definition Range.h:119
constexpr Range(T min, T max)
Constructor.
Definition Range.h:84
constexpr bool isInRange(const T &value) const
Check if the value is in range.
Definition Range.h:107
bool operator==(const Range< T > &other) const
Comparison operator.
Definition Range.h:113
std::string toString() const
Get the range as string.
Definition Range.h:125
T Type
Underlying type.
Definition Range.h:78
constexpr const T & max() const
Get the maximum value of the range.
Definition Range.h:97
constexpr Range()=default
Default constructor.
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:84
std::ostream & operator<<(std::ostream &stream, const Array2D< T > &array)
Serialize array information to a stream.
Definition Array2D.h:283