Topic: Do input iterators have to support ->, even if value_type is non-class?
Author: Kevin_VanHorn@ndsu.nodak.edu (Kevin S. Van Horn)
Date: Tue, 22 Oct 2002 21:25:24 +0000 (UTC) Raw View
The standard says that for any input iterator, i->m must be valid if
(*i).m is. This seems to me to indicate that all non-pointer input
iterator types must be classes defining operator->(), because m could
always be ~T(), where T is the value type for the iterator. If I'm
reading Section 12.4, paragraph 15 correctly, x.~T() is syntactically
valid when x is of a scalar type T as well as of a class type T.
Is my reasoning correct? Is it possible for a non-pointer type to
satisfy the input or forward iterator requirements without being a
class that defines an operator->()?
\
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]