CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    14

    Help needed with STL maps!

    Hi!

    I'm using the STLport with VC 4.0. In most cases it works.

    However I get in trouble when I try to store iterators of a map or a multimap
    in another container of STL.

    E.g. the two following code fragments show what I mean:

    typedef map<CString, int, compare> map_str;
    typedef multimap<int, map_str::iterator> map_int;

    So, when I make entries in the maps, like this:

    map_str smap;
    map_int imap;
    pair<map_str::iterator, bool> result = smap.insert (pair<CString, int> ("Some string", 123));
    imap.insert (pair<int, map_str::iterator> (123, result.first);

    I get an Internal-Compiler-Error when i use the function equal_range or count.
    VC-Debugger points to the following line of stl_pair.h:

    pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) {}

    I also get problems when i try to create a vector of iterators...

    Please help, if anybody got an idea.
    Best regards.
    Alan.


  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Help needed with STL maps!

    Have you tried to compile the program using another compiler that supports STL, or a newer version of VC++? With these types of problems, it's always a good thing to have two compilers. If one dies or gives a cryptic error message, you have the other to possibly clarify the problem.

    Regards,

    Paul McKenzie


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured