begin()cannot return the link to Iterator; it should return value Iteratorby value.
When a user-declared conversion to is called Iterator, it gives a temporary object Iterator. A link other than const cannot be bound to a temporary one, so the error you get when the begin()link returns.
However, the conversion function that returns Iteratoris unusual at best.
source
share