@@ -483,8 +483,12 @@ class serialize
483483 template <typename T>
484484 std::istream& read (std::istream& is, T &t_, bool readPrependedType = true )
485485 {
486- static_assert (!(std::is_pointer<T>::value && std::is_arithmetic<typename std::remove_pointer<T>::type>::value),
487- " T cannot be a pointer to a built-in data type" );
486+ static_assert (!is_unsupported_container<T>::value, " Unsupported C++ container type" );
487+
488+ static_assert (!(std::is_pointer<T>::value &&
489+ (std::is_arithmetic<typename std::remove_pointer<T>::type>::value ||
490+ std::is_class<typename std::remove_pointer<T>::type>::value)),
491+ " T cannot be a pointer to a built-in or custom data type" );
488492
489493 if (check_stop_parse (is))
490494 return is;
@@ -534,8 +538,10 @@ class serialize
534538 {
535539 static_assert (!is_unsupported_container<T>::value, " Unsupported C++ container type" );
536540
537- static_assert (!(std::is_pointer<T>::value && std::is_arithmetic<typename std::remove_pointer<T>::type>::value),
538- " T cannot be a pointer to a built-in data type" );
541+ static_assert (!(std::is_pointer<T>::value &&
542+ (std::is_arithmetic<typename std::remove_pointer<T>::type>::value ||
543+ std::is_class<typename std::remove_pointer<T>::type>::value)),
544+ " T cannot be a pointer to a built-in or custom data type" );
539545
540546 // Is T type a built-in data type (e.g. float, int, ...)?
541547 if (std::is_class<T>::value == false )
0 commit comments