This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/33490] parallel v3: std::accumulate assumes iterators have std::iterator_traits declared
- From: "singler at ira dot uka dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Sep 2007 18:42:08 -0000
- Subject: [Bug libstdc++/33490] parallel v3: std::accumulate assumes iterators have std::iterator_traits declared
- References: <bug-33490-102@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from singler at ira dot uka dot de 2007-09-19 18:42 -------
The standard states clearly (24.3.1):
"Accordingly, it is required that if Iterator is the type of an iterator, the
types
iterator_traits<Iterator>::difference_type
iterator_traits<Iterator>::value_type
iterator_traits<Iterator>::iterator_category
be defined as..."
That this is missing in the requirement lists in 24.1.1 and 24.1.2 is probably
due to the fact that it does not concern the Iterator class itself, but
iterator_traits<Iterator>.
The Sun SGI documentation also states:
"If you are defining a new iterator type I, then you must ensure that
iterator_traits<I> is defined properly."
Thus, struct X is an invalid iterator.
--
singler at ira dot uka dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |singler at ira dot uka dot
| |de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33490