P
Paulo Matos
HI all,
I'm using unordered_map from TR1.
I have a table variable which is a private member of a template class:
template<typename K, typename D, typename EQ>
class FooClass {
public:
void method(K& key) {
const unordered_map<K, D, hash<K>, EQ>::const_iterator it =
table.find(key);
....
}
private:
unordered_map<K, D, hash<K>, EQ> table;
};
I get an error in the const_iterator line:
error: expected initializer before 'it'
Any ideas on what the problem might be?
I think I have all the includes and using keywords ok (on top of file):
#include <tr1/unordered_map>
using std::tr1::unordered_map;
using std::tr1::hash;
Any ideas?
Cheers,
Paulo Matos
I'm using unordered_map from TR1.
I have a table variable which is a private member of a template class:
template<typename K, typename D, typename EQ>
class FooClass {
public:
void method(K& key) {
const unordered_map<K, D, hash<K>, EQ>::const_iterator it =
table.find(key);
....
}
private:
unordered_map<K, D, hash<K>, EQ> table;
};
I get an error in the const_iterator line:
error: expected initializer before 'it'
Any ideas on what the problem might be?
I think I have all the includes and using keywords ok (on top of file):
#include <tr1/unordered_map>
using std::tr1::unordered_map;
using std::tr1::hash;
Any ideas?
Cheers,
Paulo Matos