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<<" ";
}
}
Yes, MSVC 9 (i.e 2008) runs it properly, but MSVC 7.1 (2003 . NET) fails to compile it.
It looks like, for some reason node_ = data::next_group(node_); from increment_group() tries to construct data, which is a typedef to BOOST_UNORDERED_TABLE_DATA even while using static function for that.
just changing the statement to node_ = next_group(node_); (hash_table_impl.hpp cvs line no 301) works. so it seems, msvc 7. either doesn't support calling static function by class name typedef, or the data typedef is confused with some other (like BOOST_UNORDERED_TABLE) note node_ = BOOST_UNORDERED_TABLE_DATA::next_group(node_); also works fine.
i tried to produce some simple test case for this, like
class outer{
public:
typedef outer outer_t;
inline static void func(){}
class inner{
void func1(){
outer_t::func();// func() this works;or outer::func() works
}
};
};
this doesn't work in msvc 7.1 but works in 9.0 . i am not sure if it is valid in standard though.
The error is,
E:\lib\boost\trunk\boost\unordered\detail\hash_table_impl.hpp(301): error C2039: 'hash_table_data_equivalent_keys<std::allocator<std::pair<char const ,int> > >' : is not a member of 'boost::unordered_detail::hash_table_data_equivalent_keys<Alloc>::iterator_base'
with
[
Alloc=boost::unordered_detail::hash_types_equivalent_keys<std::pair<const char,int>,char,boost::hash<char>,std::equal_to<char>,std::allocator<std::pair<const char,int>>>::value_allocator
]
thanks
abir