Fix ambiguous function template overload in json.hpp

There are already the "small signed/unsigned overloads" of loadValue that
are always selected for integers smaller than 64 bits.

The fixed overloads conflicted with the "small signed/unsigned overloads"
if:

- long is smaller than 64 bits
- int32_t is not typedef for long
This commit is contained in:
Kalle Huttunen
2016-01-22 10:13:52 +02:00
parent 742a585626
commit 977062eeb1
+2 -2
View File
@@ -641,14 +641,14 @@ namespace cereal
//! Serialize a long if it would not be caught otherwise
template <class T> inline
typename std::enable_if<std::is_same<T, long>::value &&
!std::is_same<T, std::int32_t>::value &&
sizeof(T) >= sizeof(std::int64_t) &&
!std::is_same<T, std::int64_t>::value, void>::type
loadValue( T & t ){ loadLong(t); }
//! Serialize an unsigned long if it would not be caught otherwise
template <class T> inline
typename std::enable_if<std::is_same<T, unsigned long>::value &&
!std::is_same<T, std::uint32_t>::value &&
sizeof(T) >= sizeof(std::uint64_t) &&
!std::is_same<T, std::uint64_t>::value, void>::type
loadValue( T & t ){ loadLong(t); }
#endif // _MSC_VER