Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How is reverse_iterator::base "explicit"

80 views
Skip to first unread message

Bo Persson

unread,
Jun 28, 2015, 4:20:05 PM6/28/15
to

The reverse_iterator class template has one member

Iterator base() const; // explicit



What is the meaning of "explicit" here?



Bo Persson


--
[ comp.std.c++ is moderated. To submit articles, try posting with your ]
[ newsreader. If that fails, use mailto:std-cpp...@vandevoorde.com ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]

Martin Bonner

unread,
Jun 29, 2015, 2:30:08 PM6/29/15
to

On Sunday, 28 June 2015 21:20:05 UTC+1, Bo Persson wrote:
> The reverse_iterator class template has one member
>
> Iterator base() const; // explicit

> What is the meaning of "explicit" here?

If you have a reverse iterator, and you want to get the
underlying forward iterator, you can get it by explicitly
calling the "base()" member. There is no way to get it
implicitly by a cast.

I think the standard would be improved by removing that
comment from the specification, and adding it as a rather more
wordy [Note:]
0 new messages