diff --git a/src/checkpoint/container/list_serialize.h b/src/checkpoint/container/list_serialize.h index 854eb286..67eb9587 100644 --- a/src/checkpoint/container/list_serialize.h +++ b/src/checkpoint/container/list_serialize.h @@ -106,11 +106,25 @@ inline void serialize(Serializer& s, std::deque& lst) { serializeOrderedContainer(s, lst); } -// FIXME: 'typename std::list::iterator' doesn't work here -// -// this depends on the (standard library) implementation details and -// doesn't work when libc++ is used -// last resort would be to use '#if defined(_LIBCPP_VERSION)))' + +/** + * Note: 'typename std::list::iterator' doesn't work here. + * This depends on the (standard library) implementation details and requires + * checking for '_LIBCPP_VERSION' for libc++ to work. + */ +#if defined(_LIBCPP_VERSION) +template < + typename SerializerT, + typename T, + typename VoidPtr, + typename = std::enable_if_t< + std::is_same::value + > +> +inline void serialize( + SerializerT& s, const std::__list_iterator& iter +) { +#else template < typename SerializerT, typename T, @@ -118,10 +132,12 @@ template < std::is_same::value > > -inline void serialize(SerializerT& s, std::_List_iterator& iter) { +inline void serialize(SerializerT& s, const std::_List_iterator& iter) { +#endif s.countBytes(iter); } + } /* end namespace checkpoint */ #endif /*INCLUDED_CHECKPOINT_CONTAINER_LIST_SERIALIZE_H*/