how to decide whether it is in the std?

:wave: :wave:
hello,everyone ,
i have a problem:
#include<iostream>
#include<set>

#1 int main()
#2 {
#3 std::set<int> intset;
#4 intset.insert(10);
#5 intset.insert(5);
#6 intset.insert(1);
#7 intset.insert(3);
#8 intset.insert(8);
#9
#10 std::cout<<"contents of set:"<<std::endl;

#11 std::set<int>::iterator iter;
#12 for(iter=intset.begin();iter!=intset.end();iter++)
#13 std::cout<<*iter<<std::endl;
#14 return 0;

#15 }

in the line#11,when i didnot give the suffix--std:: ,the system gives the errors :
set is not declared,
as for std,i know little about it ,then how i know when a thing is in the std or not ,how to cope with the situation?
:wave: :wave:
[860 byte] By [jolley] at [2007-11-18 21:40:51]
# 1 Re: how to decide whether it is in the std?
You know that 'set' is a standard container, so it has to live in the namespace std. As the iterator is a typedef owned by set... Ok, to know that, you need to read the documentation, a book or something. To put it another way: there is no way how you could guess in what namespace an unknown class lives in.

<nitpick>std:: is a prefix, not a suffix</nitpick>
Gabriel Fleseriu at 2007-11-9 0:34:24 >
# 2 Re: how to decide whether it is in the std?
thanks a lot Gabriel Fleseriu
jolley at 2007-11-9 0:35:16 >