1 | //===----------------------------------------------------------------------===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | // UNSUPPORTED: c++03, c++11, c++14, c++17 |
10 | |
11 | #include <set> |
12 | |
13 | #include "associative_container_benchmarks.h" |
14 | #include "benchmark/benchmark.h" |
15 | |
16 | template <class K> |
17 | struct support::adapt_operations<std::multiset<K>> { |
18 | using ValueType = typename std::multiset<K>::value_type; |
19 | using KeyType = typename std::multiset<K>::key_type; |
20 | static ValueType value_from_key(KeyType const& k) { return k; } |
21 | static KeyType key_from_value(ValueType const& value) { return value; } |
22 | |
23 | using InsertionResult = typename std::multiset<K>::iterator; |
24 | static auto get_iterator(InsertionResult const& result) { return result; } |
25 | }; |
26 | |
27 | int main(int argc, char** argv) { |
28 | support::associative_container_benchmarks<std::multiset<int>>("std::multiset<int>" ); |
29 | |
30 | benchmark::Initialize(&argc, argv); |
31 | benchmark::RunSpecifiedBenchmarks(); |
32 | benchmark::Shutdown(); |
33 | return 0; |
34 | } |
35 | |