P
peter_k
Hi
I've defined hash_map in my code using this:
-------------------------------------------
#include <string>
#include <hash_map.h>
&
namespace __gnu_cxx {
template<>
struct hash<std::string> {
hash<char*> h;
size_t operator()(const std::string &s) const {
return h(s.c_str());
};
};
};
&
hash_map<string, string, hash<string> > words;
-------------------------------------------
I have no trouble with saving or reading data from this hash_map. But
when i'm doing something like...
hash_map<string, string, hash<string> >::iterator pointer;
pointer = words.begin();
cout << *pointer; // <-- error here
.... it display me compile error at the end
This is one of error:
103 D:\12345678\words.cpp no match for 'operator<<' in 'std:perator<<
Thanks for the reply
I've defined hash_map in my code using this:
-------------------------------------------
#include <string>
#include <hash_map.h>
&
namespace __gnu_cxx {
template<>
struct hash<std::string> {
hash<char*> h;
size_t operator()(const std::string &s) const {
return h(s.c_str());
};
};
};
&
hash_map<string, string, hash<string> > words;
-------------------------------------------
I have no trouble with saving or reading data from this hash_map. But
when i'm doing something like...
hash_map<string, string, hash<string> >::iterator pointer;
pointer = words.begin();
cout << *pointer; // <-- error here
.... it display me compile error at the end
This is one of error:
103 D:\12345678\words.cpp no match for 'operator<<' in 'std:perator<<
_Alloc = said:&)(&std::cout)), ((const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)((const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*)(&slowo)))) << wskaznik'
Thanks for the reply