Make container wrapper callback functions mutable

It seems at least std::mem_fn callable wrapper type call operator
is not guaranteed to be const, so we need to be able to call on
a non const object. This should do for now.

Fixes #978
This commit is contained in:
Maxime Coste 2016-12-14 13:25:55 +00:00
parent 8e351e8285
commit dfb030da6e

View File

@ -101,7 +101,7 @@ struct FilterView
Iterator end() const { return {*this, std::end(m_container), std::end(m_container)}; } Iterator end() const { return {*this, std::end(m_container), std::end(m_container)}; }
Container m_container; Container m_container;
Filter m_filter; mutable Filter m_filter;
}; };
template<typename Filter> template<typename Filter>
@ -158,7 +158,7 @@ struct TransformView
Iterator end() const { return {*this, std::end(m_container)}; } Iterator end() const { return {*this, std::end(m_container)}; }
Container m_container; Container m_container;
Transform m_transform; mutable Transform m_transform;
}; };
template<typename Transform> template<typename Transform>