Skip to content

Commit

Permalink
Adjust type to support arbitrary containers
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRStevens committed Mar 7, 2019
1 parent 79e461c commit 782ff6b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Stream/Writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ namespace Stream
}

// Vector of non trivially copyable data types
template<typename T, typename A>
template<typename T>
inline
std::enable_if_t<!std::is_trivially_copyable<T>::value>
Write(const std::vector<T, A>& container) {
std::enable_if_t<!std::is_trivially_copyable<typename T::value_type>::value>
Write(const T& container) {
// Loop over all elements and call custom serializer for type
for (const auto& element : container) {
Write(element); // Call custom serializer
Expand Down

0 comments on commit 782ff6b

Please sign in to comment.