page = arthur o'dwyer – stuff mostly about c++
url = https://quuxplusone.github.io/blog
iterator
IS-NOT-A
const_iterator
antipatterns implementation-divergence library-design stl-classic
Consider the following code snippet ( Godbolt ). Would you believe that it compiles on MSVC (with Microsoft’s STL) but not on libc++ or libstdc++?
template<class C> struct Wrap { Wrap(C&); operator C::iterator() const; }; template<class C> void f(C&, typename C::const_iterator); int main() { std::list<int> v; f(v, Wrap(v)); } ...