Re: [VC 7.1] const_reverse_iterator problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Aurélien REGAT-BARREL (nospam-aregatba_at_yahoo.fr.invalid)
Date: 01/24/05

  • Next message: Ulrich Eckhardt: "Re: [VC 7.1] const_reverse_iterator problem"
    Date: Mon, 24 Jan 2005 14:12:17 +0100
    
    

    > This is because of a defect in the standard:
    > http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#280
    > http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#179

    Thank you for the links. But I still don't understand.
    I'm not trying to compare 2 different kinds of iterators (reverse vs
    non-reverse, or const vs non-const), but 2 reverse_const_iterator.
    Since the following code compiles well:

        set<int> s;
        set<int>::const_reverse_iterator a = s.rbegin();
        set<int>::const_reverse_iterator b = s.rend();
        if ( a != b ) {}

    I don't understand why this one is problematic :

        if ( a != s.rend() ) {}

    An overloaded version of rend() which returns a const_reverse_iterator
    exists, that's why I don't understand where is the problem.

    -- 
    Aurélien REGAT-BARREL
    

  • Next message: Ulrich Eckhardt: "Re: [VC 7.1] const_reverse_iterator problem"

    Relevant Pages

    • Re: VS: operator <<(...const std::string&) does not call ->rdbuf()
      ... Maybe there is a defect in the Standard, ... sputnto write more than one character in one go. ... so rather than writing to the buffer as temporary ...
      (microsoft.public.vc.language)
    • Re: Count data comparsion
      ... I want to compare an old and new process before implementing the new ... Process A - Sample size taken normally for inspection is 2000 items ... allow some overlap and still have a high confidence in the result. ... The expected defect rate is < 0.01%. ...
      (sci.stat.consult)
    • Re: Requesting advice how to clean up C code for validating string represents integer
      ... Linkname: c standard - clc-wiki ... being able to compare unrelated pointers, ...
      (comp.lang.c)
    • Re: Versions
      ... CVersionTypeAlpha -- class for alpha comparation ... So make a special check in the Compare methods for this rule. ... Another way is via a mapping, where the CVersionTypeAlpha class converts all ... you'll never get a standard implementation for all cases.. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: VS: operator <<(...const std::string&) does not call ->rdbuf()
      ... characters as if by calling os.rdbuf->sputn", nothing about "should" or "shall" or some other requirement. ... Maybe there is a defect in the Standard, or a defect in Dinkumware's implementation. ... 'sputc' is specified to check the availability of the room in the buffer using the pointers, and call 'overflow' where you're supposed to dump the characters, and change the pointers. ...
      (microsoft.public.vc.language)