Boost logo

Boost Users :

From: Daniel James (daniel_james_at_[hidden])
Date: 2008-03-20 11:36:10


On 20/03/2008, abir basak <abirbasak_at_[hidden]> wrote:
>
> Here the multimap version runs correctly, but unordered_multimap fails
> to run in the call equal_range (compiler MSVC 7.1 .NET 2003, and
> standard library from MS) ... the boost svn checkout from HEAD today)
> Thanks

I don't have access to that compiler. I tried running similar code in
Visual C++ 6.5 and Visual C++ express 8, and they both worked. I can
try adding something to the unit tests but that will take me a while
to work through. At the end of this email is the code I tested with,
can you try it on your compiler? If it works, I'm doing something
different to you, do you have any idea what?

thanks,

Daniel

#include <boost/unordered_map.hpp>
#include <boost/tuple/tuple.hpp>
#include <iostream>

int main() {
       typedef boost::unordered_multimap<char, int> Mymap;
       Mymap c1;

       c1.insert(Mymap::value_type('a', 1));
       c1.insert(Mymap::value_type('a', 2));
       c1.insert(Mymap::value_type('b', 3));
       c1.insert(Mymap::value_type('c', 4));

       Mymap::iterator it,end;
       boost::tie(it,end) = c1.equal_range('a');
       for( ; it!=end; ++it) {
               std::cout<<(*it).second<<" ";
       }
}


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net