[newbie-unordered_set] string example

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. 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; Regards, - Soumen -- View this message in context: http://www.nabble.com/-newbie-unordered_set--string-example-tp26009431p26009... Sent from the Boost - Users mailing list archive at Nabble.com.

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
participants (2)
-
Soumen
-
Steven Watanabe