
David Abrahams wrote:
John Torjo <john.lists@torjo.com> writes:
time, you don't have to name the element type ;-)
of course ;) the element type is deduced from the container type. For instance, if you want a constant range, just do: crange<const container> r(cont); //... etc
But container is usually "spelt something<element_type>", so I'd pick naming the element type over naming the container type any day.
But it's technically not possible. Think about: typedef std::deque<int> d_array; typedef std::vector<int> v_array; d_array d; v_array v; crange<d_array> r(d); // ok crange<v_array> r(v); // ok However, had I used crange<int> r(d); // how do I know what iterators to keep inside? crange<int> r(v); // how do I know what iterators to keep inside? Best, John