Containers are required to provide an iterator
type which is implicitly convertible to a const_iterator
. Given this, I am trying to use auto
Why does auto deduce a typ[e in this case that is not convertible to const_iterator?
begin()
:Signatures:
iterator begin();
const_iterator begin() const;
You declared your vector as Packets test (100);
, which is non const.
If you declare it const, auto
type deduction will have the second begin()
overload as a best (and unique) match.
It compiles and run with this simple fix.