The auto
type of C++11 is handy, so now one wants a const_auto
type, too. For example, supposing std::list<T> a;
, if
auto p = a.begin();
has the type std::list<T>::iterator
, then one wishes that
const_auto p = a.begin();
had the type std::list<T>::const_iterator
. Unfortunately, C++11 does not seem to have heard of const_auto
. Therefore, how can one achieve the desired effect with good style, please?
(For information, a related question is asked and answered here.)