A
Amit Bhatia
Hi,
I have defined something like the following in tree.h file:
//everything else including using namespace __gnu_cxx;
typedef hash_map<pair<int,int>, Qd_Node, Qd_Node_Hasher> Loc_Tree;
vector<Loc_Tree> tree;
//more stuff;
Now when I try do something like this in tree.C file:
#include "tree.h"
//
Qd_Node node(//constructor);
tree[0].insert(node);
the compiler complains with the following message:
error: no matching function for call to `
std:air<typename __gnu_cxx::hashtable<std:air<const _Key, _Tp>,
_Key,
_HashFcn, std::_Select1st<std:air<const _Key, _Tp> >, _EqualKey,
_Alloc>::iterator, bool> __gnu_cxx::hash_map<_Key, _Tp, _HashFcn,
_EqualKey,
_Alloc>::insert(typename __gnu_cxx::hashtable<std:air<const _Key,
_Tp>,
_Key, _HashFcn, std::_Select1st<std:air<const _Key, _Tp> >, _EqualKey,
_Alloc>::value_type&) [with _Key = std:air<int, int>, _Tp =Qd_Node,
_HashFcn =Qd_Node_Hasher, _EqualKey = std::equal_to<std:air<int,
int> >, _Alloc = std::allocator<Qd_Node>]
From what I read on the SGI website, this looks correct to me. I am
trying to insert an object in the hash_map, using defined function.
Why is the compiler complaining?
thanks,
-a.
I have defined something like the following in tree.h file:
//everything else including using namespace __gnu_cxx;
typedef hash_map<pair<int,int>, Qd_Node, Qd_Node_Hasher> Loc_Tree;
vector<Loc_Tree> tree;
//more stuff;
Now when I try do something like this in tree.C file:
#include "tree.h"
//
Qd_Node node(//constructor);
tree[0].insert(node);
the compiler complains with the following message:
error: no matching function for call to `
/usr/include/gcc/darwin/3.3/c++/ext/hash_map:181: error: candidates are:Qd_Node said:>::insert(Qd_Node&)'
std:air<typename __gnu_cxx::hashtable<std:air<const _Key, _Tp>,
_Key,
_HashFcn, std::_Select1st<std:air<const _Key, _Tp> >, _EqualKey,
_Alloc>::iterator, bool> __gnu_cxx::hash_map<_Key, _Tp, _HashFcn,
_EqualKey,
_Alloc>::insert(typename __gnu_cxx::hashtable<std:air<const _Key,
_Tp>,
_Key, _HashFcn, std::_Select1st<std:air<const _Key, _Tp> >, _EqualKey,
_Alloc>::value_type&) [with _Key = std:air<int, int>, _Tp =Qd_Node,
_HashFcn =Qd_Node_Hasher, _EqualKey = std::equal_to<std:air<int,
int> >, _Alloc = std::allocator<Qd_Node>]
From what I read on the SGI website, this looks correct to me. I am
trying to insert an object in the hash_map, using defined function.
Why is the compiler complaining?
thanks,
-a.