map problem... 
Author Message
 map problem...

I'm working with a MFC Application, and i want to create a map, but I cannot use
the std namespace. The compiler says that is not declared. The code is the
following:

     // Version 1
     #include <map>
     using namespace std;
     typedef map<int, string, less<int> > maptype;

    // Version 2
    #include <map>
    typedef std::map<int, string, less<int> > maptype;

Thanks,
   Marta.



Sun, 12 Oct 2003 03:21:43 GMT  
 map problem...
What exactly does the compiler say is not declared?  Your example
uses std::string, so you will need to include <string> as well.


Sun, 12 Oct 2003 04:01:16 GMT  
 map problem...
and if you don't use the namespace, you certainly should use a prefix std
with any keyword from stl:

// Version 2
#include <map>
#include <string>

typedef std::map<int, std::string, std::less<int> > maptype;

--
mr.black's here...



Sun, 12 Oct 2003 21:30:31 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Message map problem

2. Screen Mapping Problem

3. attributes -> interface map problems

4. STL map problem

5. Borland c++ v4.02 DOS Powerpack Key map problem

6. Template map problem

7. VC++5.0 Map problem

8. Unregular message mapping problem

9. MFC Message mapping problem

10. message mapping problem

11. Client Area Mapping Problem

12. File Mapping Problems

 

 
Powered by phpBB® Forum Software