Fix integer wire serialization ambiguities

This commit is contained in:
Lee Clagett 2020-09-23 15:48:48 -04:00
parent 8c8c79e31c
commit 47f9ea4c7a

View file

@ -82,18 +82,26 @@ namespace wire
{
dest.integer(source);
}
inline void write_bytes(writer& dest, const std::intmax_t source)
inline void write_bytes(writer& dest, const long source)
{
dest.integer(source);
dest.integer(std::intmax_t(source));
}
inline void write_bytes(writer& dest, const long long source)
{
dest.integer(std::intmax_t(source));
}
inline void write_bytes(writer& dest, const unsigned source)
{
dest.unsigned_integer(source);
}
inline void write_bytes(writer& dest, const std::uintmax_t source)
inline void write_bytes(writer& dest, const unsigned long source)
{
dest.unsigned_integer(source);
dest.unsigned_integer(std::uintmax_t(source));
}
inline void write_bytes(writer& dest, const unsigned long long source)
{
dest.unsigned_integer(std::uintmax_t(source));
}
inline void write_bytes(writer& dest, const double source)