In instantiation of 'Internal::hash_code_base<const
std::basic_string<char, std::char_traits<char>, std::allocator<char>
, std::pair<const std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, unsigned int>,
Internal::extract1st<std::pair<const std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, unsigned int> >,
std::equal_to<const std::basic_string<char, std::char_traits<char>,
std::allocator<char> > >, std::tr1::hash<const std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
Internal::mod_range_hashing, Internal::default_ranged_hash, false>':
Is probably something that has been fixed or improved between the
versions. Is there any workaround?
Thanks a lot,
Ray
Woah this is way odd but based on my tests,
unordered_map::iterator has no default constructor.
This is what you seem to be encountering. I am not
sure if that is a bug on G++'s part or not or if
TR1 specifies that it need not be default constructible.
--------------------------------------------------------
#include <tr1/unordered_map>
#include <string>
using namespace std;
using namespace std::tr1;
typedef unordered_map<string, unsigned> StringHash;
int
main()
{
StringHash myHashTable;
// assume you added some stuff in it
StringHash::const_iterator iter( myHashTable.begin() );
}
Yes, it seems that the iterator does not have a default constructor.
I hope I am wrong. :)