A class that exposes a const_iterator, but does not expose a mutable iterator, works with std:: algorithms and range-for() loop, but does not work with boost range. // This works with std algorithms and range-for, but not with boost range. class C { public: typedef blah const_iterator; const_iterator begin() const; const_iterator end() const; }; const C c; for (auto x : c) { } // OK std::for_each(std::begin(c), std::end(c), fn); // OK boost::for_each (c, fn); // ERROR: fails SinglePassRange concept (GCC-6.2) The workaround is to add a non-const iterator type that is the same as the const iterator, and to add two additional non-const begin/end methods. class D { public: typedef blah const_iterator; const_iterator begin() const; const_iterator end() const; // kludge to make it work with boost. typedef const_iterator iterator; iterator begin(); iterator end(); }; const D d; boost::for_each (d, fn); // OK Is there a simpler solution?