18 #ifndef CORE_UBUNTU_MEDIA_VIDEO_DIMENSIONS_H_ 19 #define CORE_UBUNTU_MEDIA_VIDEO_DIMENSIONS_H_ 67 template<DimensionTag Tag,
typename IntegerType>
71 static_assert(std::is_integral<IntegerType>::value,
"IntWrapper<> only supports integral types.");
75 template<
typename AnyInteger>
76 explicit IntWrapper(AnyInteger value) : value{
static_cast<ValueType
>(value)} {}
78 template<
typename T = IntegerType>
81 static_assert(std::is_arithmetic<T>::value,
"as() only supports arithmetic types.");
82 return static_cast<T
>(value);
89 template<DimensionTag Tag,
typename IntegerType>
90 std::ostream& operator<<(std::ostream& out, IntWrapper<Tag, IntegerType>
const& value)
92 out << value.template as<>();
96 template<DimensionTag Tag,
typename IntegerType>
99 return lhs.template as<>() == rhs.template as<>();
102 template<DimensionTag Tag,
typename IntegerType>
105 return lhs.template as<>() != rhs.template as<>();
108 template<DimensionTag Tag,
typename IntegerType>
111 return lhs.template as<>() <= rhs.template as<>();
114 template<DimensionTag Tag,
typename IntegerType>
117 return lhs.template as<>() >= rhs.template as<>();
120 template<DimensionTag Tag,
typename IntegerType>
123 return lhs.template as<>() < rhs.template as<>();
126 template<DimensionTag Tag,
typename IntegerType>
129 return lhs.template as<>() > rhs.template as<>();
145 #endif // CORE_UBUNTU_MEDIA_VIDEO_DIMENSIONS_H_