louisdx / cxx-prettyprint

A header-only library for C++(0x) that allows automagic pretty-printing of any container.
http://louisdx.github.com/cxx-prettyprint/
Boost Software License 1.0
557 stars 73 forks source link

Accept iterators with a non-void value_type #28

Open fsimonis opened 5 years ago

fsimonis commented 5 years ago

This PR changes has_const_iterator to additionally check 1) for std::iterator_traits to exist and 2) for its return_type to be non-void.

This catches additional cases and is compatible with the iterator rules up to C++20.

Motivation for this change is the incompatibility with the new iterator interface of Eigen3, which sets const_iterator = void for non-vector types. This breaks prettyprint.