Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
29 lines
483 B
C++
29 lines
483 B
C++
#include <utility>
|
|
|
|
#pragma once
|
|
|
|
namespace mln {
|
|
|
|
template <class T>
|
|
class Range {
|
|
public:
|
|
constexpr Range(T min_, T max_)
|
|
: min(std::move(min_)),
|
|
max(std::move(max_)) {}
|
|
|
|
T min;
|
|
T max;
|
|
};
|
|
|
|
template <class T>
|
|
constexpr bool operator==(const Range<T>& a, const Range<T>& b) {
|
|
return a.min == b.min && a.max == b.max;
|
|
}
|
|
|
|
template <class T>
|
|
constexpr bool operator!=(const Range<T>& a, const Range<T>& b) {
|
|
return !(a == b);
|
|
}
|
|
|
|
} // namespace mln
|