Boost logo

Boost Users :

Subject: Re: [Boost-users] Using boost::uuids::uuid as a map index
From: Klaim - Joël Lamotte (mjklaim_at_[hidden])
Date: 2011-12-10 18:22:29


Hi,

On Sat, Dec 10, 2011 at 17:22, Tim Burgess <tim_at_[hidden]> wrote:

> All look-ups within the map based on the UUID then fail, as adding the
> object to the map is essentially a copy operation and UUID is non-copyable,
> so new unique identifiers were generated. I then tried:
>
> Std::map <boost::uuids::uuid *, myClass*> myMap;
>

AFAIK uuid is copyable as it's a POD.

However, I don't know about this problem but I remember having failed to
make uuid a key of map (I don't remember the reason).

If that can help you, I'm using a workaround to allow this : I convert the
uuid to std::string (using the generator function) and use it in my whole
application to allow finding by uuid from maps. That's obviously more
expensive but it works fine.

Joël Lamotte



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