
push_back is designed to be non-mutating. That is why. This is true of all the views returned from 'algos', by design. What you can do is to make a container from the view through, e.g. as_vector, as_list. It is *not* true that all sequences return const refs to its elements. Containers definitely return references, otherwise get<N>(c)= expr will not be possible.
Also, front and back return non-const reference, but thats not the point. During iteration, they return const reference. Thats why this is not possible: struct mutable_func { template<class F> struct result; template<class F, class T, class U> struct result<F(T, U)> { typedef T type; }; template<class T, class U> T operator()(T && x, U y) const { return x+=y; } }; int i = 0; invoke(foo, tuple<int&, int>(i, 1)); //doesn't compile here is the output: deref.hpp:70:16: error: non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int' return deref_meta::call(i); ^~~~~~~~~~~~~~~~~~~ I believe this is because the iterators are returning a const reference to the element. Is there a workaround for this? Thanks, Paul Fultz II