forked from boostorg/unordered
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert_node_type_fail.cpp
More file actions
34 lines (30 loc) · 875 Bytes
/
insert_node_type_fail.cpp
File metadata and controls
34 lines (30 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2017 Daniel James.
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/unordered_map.hpp>
#include <boost/unordered_set.hpp>
int main()
{
#if defined(UNORDERED_TEST_MAP)
typedef boost::unordered_map<int, int> container;
container x;
x.emplace(1, 1);
#elif defined(UNORDERED_TEST_MULTIMAP)
typedef boost::unordered_multimap<int, int> container;
container x;
#elif defined(UNORDERED_TEST_SET)
typedef boost::unordered_set<int> container;
container x;
x.emplace(1);
#elif defined(UNORDERED_TEST_MULTISET)
typedef boost::unordered_multiset<int> container;
container x;
x.emplace(1);
#else
#define UNORDERED_ERROR
#endif
#if !defined(UNORDERED_ERROR)
container::node_type n = x.extract(x.begin());
x.insert(n);
#endif
}