Boost logo

Boost Users :

Subject: Re: [Boost-users] Using boost::uuids::uuid as a map index
From: Tim Burgess (tim_at_[hidden])
Date: 2011-12-11 09:51:12


OK, I’m recoding for the string solution now – thanks for the tip.

 

Best wishes.

 

Tim Burgess

Raised Bar Ltd

Phone: +44 (0)1827 719822

 

Don't forget to vote for improved access to music and music technology at

 

http://www.raisedbar.net/petition.htm

 

 

From: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Klaim - Joël Lamotte
Sent: 10 December 2011 23:22
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] Using boost::uuids::uuid as a map index

 

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