@@ -261,6 +261,13 @@ namespace cereal
261261 // ! Saves a nullptr to the current node
262262 void saveValue (std::nullptr_t ) { itsWriter.Null (); }
263263
264+ template <class T > inline
265+ typename std::enable_if<!std::is_same<T, int64_t >::value && std::is_same<T, long long >::value, void >::type
266+ saveValue (T val) { itsWriter.Int64 (val); }
267+ template <class T > inline
268+ typename std::enable_if<!std::is_same<T, uint64_t >::value && std::is_same<T, unsigned long long >::value, void >::type
269+ saveValue (T val) { itsWriter.Uint64 (val); }
270+
264271 private:
265272 // Some compilers/OS have difficulty disambiguating the above for various flavors of longs, so we provide
266273 // special overloads to handle these cases.
@@ -310,6 +317,8 @@ namespace cereal
310317 !std::is_same<T, unsigned long >::value,
311318 !std::is_same<T, std::int64_t >::value,
312319 !std::is_same<T, std::uint64_t >::value,
320+ !std::is_same<T, long long >::value,
321+ !std::is_same<T, unsigned long long >::value,
313322 (sizeof (T) >= sizeof (long double ) || sizeof (T) >= sizeof (long long ))> = traits::sfinae> inline
314323 void saveValue (T const & t)
315324 {
@@ -659,6 +668,12 @@ namespace cereal
659668 // ! Loads a nullptr from the current node
660669 void loadValue (std::nullptr_t &) { search (); CEREAL_RAPIDJSON_ASSERT (itsIteratorStack.back ().value ().IsNull ()); ++itsIteratorStack.back (); }
661670
671+ template <class T > inline
672+ typename std::enable_if<!std::is_same<T, int64_t >::value && std::is_same<T, long long >::value, void >::type
673+ loadValue (T & val) { search (); val = itsIteratorStack.back ().value ().GetInt64 (); ++itsIteratorStack.back (); }
674+ template <class T > inline
675+ typename std::enable_if<!std::is_same<T, uint64_t >::value && std::is_same<T, unsigned long long >::value, void >::type
676+ loadValue (T & val) { search (); val = itsIteratorStack.back ().value ().GetUint64 (); ++itsIteratorStack.back (); }
662677 // Special cases to handle various flavors of long, which tend to conflict with
663678 // the int32_t or int64_t on various compiler/OS combinations. MSVC doesn't need any of this.
664679 #ifndef _MSC_VER
@@ -714,6 +729,8 @@ namespace cereal
714729 !std::is_same<T, unsigned long >::value,
715730 !std::is_same<T, std::int64_t >::value,
716731 !std::is_same<T, std::uint64_t >::value,
732+ !std::is_same<T, long long >::value,
733+ !std::is_same<T, unsigned long long >::value,
717734 (sizeof (T) >= sizeof (long double ) || sizeof (T) >= sizeof (long long ))> = traits::sfinae>
718735 inline void loadValue (T & val)
719736 {
0 commit comments