5#ifndef DUNE_COMMON_CONCEPTS_CONTAINER_HH
6#define DUNE_COMMON_CONCEPTS_CONTAINER_HH
9#if __has_include(<version>) && __has_include(<concepts>)
11 #if __cpp_concepts >= 201907L && __cpp_lib_concepts >= 202002L
12 #ifndef DUNE_ENABLE_CONCEPTS
13 #define DUNE_ENABLE_CONCEPTS 1
18#if DUNE_ENABLE_CONCEPTS
57requires(T a,
const T ca)
59 typename T::value_type;
60 requires std::unsigned_integral<typename T::size_type>;
61 requires std::forward_iterator<typename T::iterator>;
62 requires std::forward_iterator<typename T::const_iterator>;
63 { a.begin() } -> std::same_as<typename T::iterator>;
64 { a.end() } -> std::same_as<typename T::iterator>;
65 { ca.begin() } -> std::same_as<typename T::const_iterator>;
66 { ca.end() } -> std::same_as<typename T::const_iterator>;
67 { a.cbegin() } -> std::same_as<typename T::const_iterator>;
68 { a.cend() } -> std::same_as<typename T::const_iterator>;
69 { a.size() } -> std::same_as<typename T::size_type>;
70 { a.max_size() } -> std::same_as<typename T::size_type>;
71 { a.empty() } -> std::convertible_to<bool>;
96concept RandomAccessContainer =
98requires(T a,
const T ca,
typename T::size_type i)
100 requires std::same_as<typename T::reference, typename T::value_type&>;
101 requires std::same_as<typename T::const_reference, const typename T::value_type&>;
102 requires std::random_access_iterator<typename T::iterator>;
103 requires std::random_access_iterator<typename T::const_iterator>;
104 { a[i] } -> std::same_as<typename T::reference>;
105 { ca[i] } -> std::same_as<typename T::const_reference>;
Namespace for concepts.
Definition: concept.hh:34