You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2007/08/26 23:19:30 UTC

[jira] Commented: (STDCXX-235) std::vector::iterators not symmetric

    [ https://issues.apache.org/jira/browse/STDCXX-235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12522889 ] 

Martin Sebor commented on STDCXX-235:
-------------------------------------

The test case below passes with gcc 4.1, bot with and without debugging iterators:

$ cat t.cpp &&  make t && rm t && make t CPPOPTS=-D_RWSTD_NO_DEBUG_ITER
#include <cassert>
#include <vector>

int main ()
{
    std::vector<bool> v;

    typedef std::vector<bool>::const_iterator const_iterator;
    typedef std::vector<bool>::iterator       iterator;

    const const_iterator cbegin = v.begin ();
    const iterator       begin  = v.begin ();

    assert (cbegin == begin);
    assert (begin  == cbegin);

    assert (!(cbegin == begin));
    assert (!(begin  == cbegin));

    assert (cbegin <= begin);
    assert (begin  <= cbegin);

    assert (cbegin >= begin);
    assert (begin  >= cbegin);

    assert (!(cbegin < begin));
    assert (!(begin  < cbegin));

    assert (!(cbegin > begin));
    assert (!(begin  > cbegin));
}
gcc -pedantic -nostdinc++ -g   -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long -Wcast-align  -I/home/sebor/stdcxx/include/ansi -D_RWSTDDEBUG   -pthread -I/home/sebor/stdcxx/include -I/build/sebor/stdcxx-gcc-4.1.1-15D/include -I/home/sebor/stdcxx/examples/include  -pthread  -L/build/sebor/stdcxx-gcc-4.1.1-15D/lib  -Wl,-R/build/sebor/stdcxx-gcc-4.1.1-15D/lib  t.cpp  -lstd15D -lsupc++ -lm -o t
gcc -pedantic -nostdinc++ -g   -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long -Wcast-align  -I/home/sebor/stdcxx/include/ansi -D_RWSTDDEBUG   -pthread -I/home/sebor/stdcxx/include -I/build/sebor/stdcxx-gcc-4.1.1-15D/include -I/home/sebor/stdcxx/examples/include -D_RWSTD_NO_DEBUG_ITER -pthread  -L/build/sebor/stdcxx-gcc-4.1.1-15D/lib  -Wl,-R/build/sebor/stdcxx-gcc-4.1.1-15D/lib  t.cpp  -lstd15D -lsupc++ -lm -o t


> std::vector<bool>::iterators not symmetric
> ------------------------------------------
>
>                 Key: STDCXX-235
>                 URL: https://issues.apache.org/jira/browse/STDCXX-235
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 23. Containers
>         Environment: all
>            Reporter: Martin Sebor
>
> Moved from the Rogue Wave bug tracking database:
> ****Created By: sebor @ Jun 27, 2000 01:05:10 PM****
> Chichiang Wan wrote:
> > 
> > Chichiang Wan wrote:
> > >
> > > Martin,
> > >
> > > Iterator relation operator support is missing for vector<bool>.  Is
> > > there a reason for that?
> > >
> > 
> > I mean for mixing iterator and const_iterator.
> Well, getting the iterators working was quite a bit of work and we just ran out of time. (Also, given the chaos surrounding vector<bool> in general I didn't consider it as important as all the others.) I would recommend users to not use the class (#define _RWSTD_NO_VECTOR_BOOL). We will probably eventually rewrite vector<bool> and the iterators but I don't think it will happen anytime soon. I created incident #23164.
> Martin
> > 
> > -- Chichiang

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.