Compile time detection for unimplemented stl-style iterators

This commit is contained in:
Eugene Zhulenev
2018-10-09 15:28:23 -07:00
parent 3f2c8b7ff0
commit c0ca8a9fa3
4 changed files with 83 additions and 1 deletions

View File

@@ -11,6 +11,19 @@ namespace Eigen {
namespace internal {
// Iterator type for XprType that do not support stl-style iterators. Allows to
// detect that expression does not support stl iterators at compile time.
template<typename XprType>
class not_an_iterator
{
not_an_iterator() : mp_xpr(0), m_index(0) {}
not_an_iterator(XprType& xpr, Index index) : mp_xpr(&xpr), m_index(index) {}
protected:
XprType *mp_xpr;
Index m_index;
};
template<typename XprType,typename Derived>
class indexed_based_stl_iterator_base
{