Boost logo

Boost Users :

Subject: Re: [Boost-users] [newbie-unordered_set] string example
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-10-28 01:04:14


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net