2
0
mirror of https://github.com/boostorg/mysql.git synced 2026-02-20 14:52:25 +00:00

Added (de)serialization tests for all basic types

This commit is contained in:
ruben
2019-10-02 08:09:21 +01:00
parent 51c84be189
commit dbd623a9e0
3 changed files with 241 additions and 298 deletions

View File

@@ -307,7 +307,7 @@ void serialize(T input, SerializationContext& ctx) noexcept
template <typename T, typename=std::enable_if_t<std::is_enum_v<T>>>
std::size_t get_size(T input, const SerializationContext&) noexcept
{
return get_fixed_size<std::underlying_type_t<T>>::value;
return get_fixed_size<ValueHolder<std::underlying_type_t<T>>>::value;
}
// Tuple-like messages

View File

@@ -19,6 +19,9 @@ struct ValueHolder
using value_type = T;
value_type value;
bool operator==(const ValueHolder<T>& rhs) const { return value == rhs.value; }
bool operator!=(const ValueHolder<T>& rhs) const { return value != rhs.value; }
};
struct int1 : ValueHolder<std::uint8_t> {};