Hi You need a const_iterator whenever you want to iterate through a const container e.g. void myfunction(const std::list& mylist_readonly) { // Causes an error at compile time=20 std::list::iterator bad_it =3D mylist_readonly.begin(); // This time is fine=09 std::list::const_iterator good_it=3D mylist_readonly.begin();=20 } Gilles -----Message d'origine----- De: Phil Beck [mailto:phil@EF-X.COM] Date: jeudi 17 mai 2001 10:25 =C0: ATL@DISCUSS.MICROSOFT.COM Objet: OT: STL Just a quickie. When iterating through a container such as :- std::list why do I sometimes need a const_iterator instead of just an iterator ? Using an iterator sometimes give me the compile error :- binary '=3D' no operator defined which takes a right hand operand of = type std::list >::iterator Phil. ---------------------------------------------------------------- Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp contains important info. Save time, search the archives at http://discuss.microsoft.com/archives/index.html . To unsubscribe, mailto:ATL-signoff-request@DISCUSS.MICROSOFT.COM ---------------------------------------------------------------- Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp contains important info. Save time, search the archives at http://discuss.microsoft.com/archives/index.html . To unsubscribe, mailto:ATL-signoff-request@DISCUSS.MICROSOFT.COM