problème avec std::set et iterator
Bonjour, j'ai le code suivant sous Visual 8 :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
std::set<int,std::greater<int> > s;
s.insert(0);
s.insert(1);
s.insert(2);
s.insert(3);
std::set<int,std::greater<int> >::const_reverse_iterator it;
cout << "affichage de s" << endl;
for(it = s.begin() ; it != s.end() ; it++)
cout << *it << endl; |
Et j'ai l'erreur suivante au niveau du it = s.begin() de la boucle for :
Citation:
error C2679: binary '=' : no operator found which takes a right-hand operand of type 'std::_Tree<_Traits>::iterator' (or there is no acceptable conversion)
with
[
_Traits=std::_Tset_traits<int,std::greater<int>,std::allocator<int>,false>
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(1842): could be 'std::reverse_iterator<_RanIt> &std::reverse_iterator<_RanIt>::operator =(const std::reverse_iterator<_RanIt> &)'
with
[
_RanIt=std::_Tree<std::_Tset_traits<int,std::greater<int>,std::allocator<int>,false>>::const_iterator
]
while trying to match the argument list '(std::reverse_iterator<_RanIt>, std::_Tree<_Traits>::iterator)'
with
[
_RanIt=std::_Tree<std::_Tset_traits<int,std::greater<int>,std::allocator<int>,false>>::const_iterator
]
and
[
_Traits=std::_Tset_traits<int,std::greater<int>,std::allocator<int>,false>
]
Quelqu'un aurait-il une idée ?
Merci d'avance