J
Jim Lynch
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:
air<const std::string, ArcNode&>':
/usr/include/c++/3.2.2/ext/stl_hashtable.h:266: instantiated from
`std::_Select1st<std:
air<const std::string, ArcNode&> >'
/usr/include/c++/3.2.2/ext/stl_hashtable.h:266: instantiated from
`__gnu_cxx::hashtable<std:
air<const std::string, ArcNode&>,
std::string, __gnu_cxx::hash<std::string>,
std::_Select1st<std:
air<const std::string, ArcNode&> >,
std::equal_to<std::string>, std::allocator<ArcNode&> >'
/usr/include/c++/3.2.2/ext/hash_map:101: instantiated from
`__gnu_cxx::hash_map<std::string, ArcNode&,
__gnu_cxx::hash<std::string>, std::equal_to<std::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::hash_map<std::string, ArcNode&,
__gnu_cxx::hash<std::string>, std::equal_to<std::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.
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:
/usr/include/c++/3.2.2/ext/stl_hashtable.h:266: instantiated from
`std::_Select1st<std:
/usr/include/c++/3.2.2/ext/stl_hashtable.h:266: instantiated from
`__gnu_cxx::hashtable<std:
std::string, __gnu_cxx::hash<std::string>,
std::_Select1st<std:
std::equal_to<std::string>, std::allocator<ArcNode&> >'
/usr/include/c++/3.2.2/ext/hash_map:101: instantiated from
`__gnu_cxx::hash_map<std::string, ArcNode&,
__gnu_cxx::hash<std::string>, std::equal_to<std::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::hash_map<std::string, ArcNode&,
__gnu_cxx::hash<std::string>, std::equal_to<std::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.