opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
associative_container.h
Go to the documentation of this file.
1#pragma once
2
3#include <concepts>
4#include <iterator>
5#include <utility>
6
7namespace osc
8{
9 // Satisfied if `T` has an associative-container-like API (i.e. it maps
10 // keys to values and provides a `.find()` method).
11 template<typename T>
12 concept AssociativeContainer = requires(T v) {
13 typename T::key_type;
14 typename T::mapped_type;
15 typename T::value_type;
16 { std::declval<typename T::value_type>().second } -> std::convertible_to<typename T::mapped_type>;
17 { v.begin() } -> std::forward_iterator;
18 { v.end() } -> std::forward_iterator;
19 { v.find(std::declval<typename T::key_type>()) } -> std::same_as<typename T::iterator>;
20 };
21}
Definition associative_container.h:12
Definition custom_decoration_generator.h:5
constexpr U to(T &&value)
Definition conversion.h:56