public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/31247]  New: std::vector::iterator::value_type is accessible
@ 2007-03-17 16:52 sylvain dot pion at sophia dot inria dot fr
  2007-03-17 17:00 ` [Bug libstdc++/31247] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 16+ messages in thread
From: sylvain dot pion at sophia dot inria dot fr @ 2007-03-17 16:52 UTC (permalink / raw)
  To: gcc-bugs

This is an "accepts invalid code" report.

The following code happens to compile with g++ (all versions),
whereas the standard does not guarantee it should (I think).
----------------------------
#include <vector>

typedef std::vector<int>::iterator Iterator;

Iterator::value_type v;
Iterator::pointer p;
Iterator::iterator_category c;
----------------------------

The problem is that developing code with g++, and introducing this
kind of code by mistake, pops up errors later when other compilers
are used (e.g. those which have pointers for std::vector::iterator).

Would it be a good idea to make the access to such types somehow non public?
For example by making them protected and making std::iterator_traits a friend?
Or maybe only available when _GLIBCXX_DEBUG is not defined ?


-- 
           Summary: std::vector::iterator::value_type is accessible
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sylvain dot pion at sophia dot inria dot fr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31247


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-09-19 11:37 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-31247-4@http.gcc.gnu.org/bugzilla/>
2011-10-28  9:32 ` [Bug libstdc++/31247] std::vector::iterator::value_type is accessible marc.glisse at normalesup dot org
2011-10-28  9:41 ` paolo.carlini at oracle dot com
2011-10-28  9:58 ` redi at gcc dot gnu.org
2011-10-28 10:20 ` marc.glisse at normalesup dot org
2011-10-29  4:24 ` sylvain.pion at sophia dot inria.fr
2014-09-19 10:33 ` redi at gcc dot gnu.org
2014-09-19 11:37 ` glisse at gcc dot gnu.org
2007-03-17 16:52 [Bug libstdc++/31247] New: " sylvain dot pion at sophia dot inria dot fr
2007-03-17 17:00 ` [Bug libstdc++/31247] " pinskia at gcc dot gnu dot org
2007-03-17 17:19 ` chris at bubblescope dot net
2007-03-17 17:35 ` sylvain dot pion at sophia dot inria dot fr
2007-03-17 17:52 ` chris at bubblescope dot net
2007-04-17 15:48 ` chris at bubblescope dot net
2007-04-17 16:04 ` pcarlini at suse dot de
2008-03-09 15:52 ` jwakely dot gcc at gmail dot com
2008-03-09 15:53 ` jwakely dot gcc at gmail dot com
2008-03-09 20:29 ` chris at bubblescope dot net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).