I've searched google for help with this one, but I haven't found it yet.
What I want is a hash map this looks like:
__gnu_cxx::hash _map<string, ArcNode> ArcNodeMap;
ArcNode is a class. It looks something like this:
class ArcNode
{
private:
// communication objects
int fdSocket;
public:
ArcNode();
~ArcNode();
int write(string);
int read(string&);
int open(string);
int state();
};
But when I try to compile I get:
In file included from main.cpp:3:
/usr/include/c++/3.2.2/bits/stl_pair.h: In instantiation of
`std::pair<cons t std::string, ArcNode&>':
/usr/include/c++/3.2.2/ext/stl_hashtable.h :266: instantiated from
`std::_Select1s t<std::pair<con st std::string, ArcNode&> >'
/usr/include/c++/3.2.2/ext/stl_hashtable.h :266: instantiated from
`__gnu_cxx::has htable<std::pai r<const std::string, ArcNode&>,
std::string, __gnu_cxx::hash <std::string> ,
std::_Select1st <std::pair<cons t std::string, ArcNode&> >,
std::equal_to<s td::string>, std::allocator< ArcNode&> >'
/usr/include/c++/3.2.2/ext/hash_map:101: instantiated from
`__gnu_cxx::has h_map<std::stri ng, ArcNode&,
__gnu_cxx::hash <std::string> , std::equal_to<s td::string>,
std::allocator< ArcNode&> >'
loggerbase.h:48 : instantiated from here
/usr/include/c++/3.2.2/bits/stl_pair.h:84: forming reference to
reference type
`ArcNode&'
/usr/include/c++/3.2.2/ext/hash_map: In instantiation of
`__gnu_cxx::has h_map<std::stri ng, ArcNode&,
__gnu_cxx::hash <std::string> , std::equal_to<s td::string>,
std::allocator< ArcNode&> >':
loggerbase.h:48 : instantiated from here
/usr/include/c++/3.2.2/ext/hash_map:182: forming reference to reference
type `
ArcNode&'
make: *** [logger] Error 1
I don't understand the reference to reference error message. Can
someone tell me what I'm doing wrong. A pointer to a tutorial that
discusses how to put objects into a hash_map would also be helpful.
Thanks,
Jim.
--
Jim Lynch
k4***@qsl.net