
28 Oct
2009
28 Oct
'09
5:04 a.m.
AMDG Soumen wrote:
I'm using boost 1.35. I wanted to use boost::intrusive::unordered_set for std::string - couldn't find an example how to do it.
Why do you want to do this? Intrusive only works with classes that have been designed for use in it. If you want to use other classes like std::string with Intrusive, you'll have to wrap them.
Can someone give a small example?
As of now I've coded using from tr1 in following way -
typedef std::tr1::unordered_set< std::string, boost::hash< std::string > > Hash; Hash tbl; tbl.insert("abcd");
bool found = tbl.find("xyz") == tbl.end() ? true : false;
If this is what you want to do, then you shouldn't need Intrusive. In Christ, Steven Watanabe