1 // (C) Copyright Andy Tompkins 2011. Permission to copy, use, modify, sell and
2 // distribute this software is granted provided this copyright notice appears
3 // in all copies. This software is provided "as is" without express or implied
4 // warranty, and with no claim as to its suitability for any purpose.
5
6 // Distributed under the Boost Software License, Version 1.0. (See
7 // accompanying file LICENSE_1_0.txt or copy at
8 // https://www.boost.org/LICENSE_1_0.txt)
9
10 // libs/uuid/test/test_uuid_in_map.cpp -------------------------------//
11
12 #include <boost/uuid/uuid.hpp>
13 #include <boost/uuid/uuid_generators.hpp>
14 #include <map>
15
16 #include <boost/detail/lightweight_test.hpp>
17
main(int,char * [])18 int main(int, char*[])
19 {
20 boost::uuids::random_generator gen;
21
22 boost::uuids::uuid u1 = gen();
23 boost::uuids::uuid u2 = gen();
24 boost::uuids::uuid u3 = gen();
25
26 std::map<boost::uuids::uuid, int> uuid_map;
27 uuid_map[u1] = 1;
28 uuid_map[u2] = 2;
29 uuid_map[u3] = 3;
30
31 BOOST_TEST_EQ(1, uuid_map[u1]);
32 BOOST_TEST_EQ(2, uuid_map[u2]);
33 BOOST_TEST_EQ(3, uuid_map[u3]);
34
35 return boost::report_errors();
36 }
37