39 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++03, c++11, c++14, c++1710 11#include <set>12 13#include "associative_container_benchmarks.h"14#include "benchmark/benchmark.h"15 16template <class K>17struct 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 template <class Allocator>27 using rebind_alloc = std::multiset<K, std::less<K>, Allocator>;28};29 30int main(int argc, char** argv) {31 support::associative_container_benchmarks<std::multiset<int>>("std::multiset<int>");32 support::associative_container_benchmarks<std::multiset<std::string>>("std::multiset<std::string>");33 34 benchmark::Initialize(&argc, argv);35 benchmark::RunSpecifiedBenchmarks();36 benchmark::Shutdown();37 return 0;38}39