dimanche 30 octobre 2016

next iterator after end() in std::list

#include <list>
int main( void )
{
    std::list< int > list0 { 1 , 2 , 3 } ;
    for ( auto current =  std::next( list0.begin() )
        ;      current != std::next( list0.end() )
        ;   ++ current )
    { /*...*/ }
    return 0;
}

does STL guarantee the correctness of current != std::next( list0.end() ) expression.?

Aucun commentaire:

Enregistrer un commentaire