1#ifndef ZSERIO_EXTENDED_H_INC
2#define ZSERIO_EXTENDED_H_INC
12template <
typename T,
typename... ARGS>
13struct is_single_type : std::false_type
16template <
typename T,
typename A1>
17struct is_single_type<T, A1> : std::is_same<T, std::decay_t<A1>>
20template <
typename T,
typename... ARGS>
21inline constexpr bool is_single_type_v = is_single_type<T, ARGS...>::value;
37 template <
typename ALLOC>
39 m_isPresent(
other.m_isPresent),
45 template <
typename ALLOC>
47 m_isPresent(
other.m_isPresent),
54 template <
typename...
ARGS,
55 typename = std::enable_if_t<!detail::is_single_type_v<
Extended,
ARGS...> &&
56 std::is_constructible_v<T,
ARGS...>>>
165 bool m_isPresent =
true;
172 if (
lhs.isPresent() &&
rhs.isPresent())
174 return lhs.value() ==
rhs.value();
176 return lhs.isPresent() ==
rhs.isPresent();
188 if (
lhs.isPresent() &&
rhs.isPresent())
190 return lhs.value() <
rhs.value();
192 return lhs.isPresent() <
rhs.isPresent();
198 if (
lhs.isPresent() &&
rhs.isPresent())
200 return lhs.value() >
rhs.value();
202 return lhs.isPresent() >
rhs.isPresent();
242struct hash<
zserio::Extended<T>>
constexpr T & operator*() noexcept
constexpr const T & operator*() const noexcept
bool isPresent() const noexcept
constexpr const T & value() const noexcept
const T * operator->() const noexcept
Extended & operator=(const Extended &other)=default
T * operator->() noexcept
constexpr Extended(ARGS &&... args)
void setPresent(bool present) noexcept
Extended(Extended &&other)=default
Extended & operator=(Extended &&other)=default
Extended(Extended &&other, const ALLOC &allocator)
Extended(const Extended &other)=default
Extended(const Extended &other, const ALLOC &allocator)
bool operator>(const BasicBitBufferView< ALLOC > &lhs, const BasicBitBufferView< ALLOC > &rhs)
bool operator==(const BasicBitBufferView< ALLOC > &lhs, const BasicBitBufferView< ALLOC > &rhs)
bool operator<(const BasicBitBufferView< ALLOC > &lhs, const BasicBitBufferView< ALLOC > &rhs)
uint32_t calcHashCode(uint32_t seedValue, const ArrayView< T, ARRAY_TRAITS > &array)
bool operator<=(const BasicBitBufferView< ALLOC > &lhs, const BasicBitBufferView< ALLOC > &rhs)
bool operator>=(const BasicBitBufferView< ALLOC > &lhs, const BasicBitBufferView< ALLOC > &rhs)
bool operator!=(const BasicBitBufferView< ALLOC > &lhs, const BasicBitBufferView< ALLOC > &rhs)