Re: [Boost-users] Boost-users Digest, Vol 1577, Issue 2

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
#include #include <iostream> int main() { typedef boost::unordered_multimap
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

On 20/03/2008, Abir Basak
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.
OK, thanks for investigating this. I'll change it to 'BOOST_UNORDERED_TABLE_DATA::next_group(node_)' or something similar. It's a bit odd that this hasn't shown up in the unit tests, but the change seems fine. I was only using 'data' for the sake of readability. Daniel
participants (2)
-
Abir Basak
-
Daniel James