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@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Klaim - Joël Lamotte
Sent: 10 December 2011 23:22
To: boost-users@lists.boost.org
Subject: Re: [Boost-users] Using boost::uuids::uuid as a map index
Hi,
On Sat, Dec 10, 2011 at 17:22, Tim Burgess <tim@raisedbar.net> 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