11#pragma once
22
33#include < concepts>
4+ #include < cstddef>
45#include < memory>
56#include < string_view>
67#include < type_traits>
@@ -81,8 +82,8 @@ namespace OpenVic {
8182 // This adds to capacity rather than size so that it can be used multiple times in a row.
8283 // If it added to size, it would only reserve enough for max(arguments...)
8384 template <typename T>
84- concept reservable = requires (T& t, size_t size) {
85- { t.capacity () } -> std::same_as<size_t >;
85+ concept reservable = requires (T& t, std:: size_t size) {
86+ { t.capacity () } -> std::same_as<std:: size_t >;
8687 t.reserve (size);
8788 };
8889
@@ -108,20 +109,18 @@ namespace OpenVic {
108109 };
109110
110111 template <typename T>
111- concept has_index = requires { typename T::index_t ; }
112- && derived_from_specialization_of<typename T::index_t , type_safe::strong_typedef>
113- && requires {
114- static_cast <std::size_t >(
115- static_cast <type_safe::underlying_type<decltype (std::declval<T>().index )>>(std::declval<T>().index )
116- );
117- };
112+ concept has_index = requires { typename T::index_t ; } &&
113+ derived_from_specialization_of<typename T::index_t , type_safe::strong_typedef> && requires {
114+ static_cast <std::size_t >(
115+ static_cast <type_safe::underlying_type<decltype (std::declval<T>().index )>>(std::declval<T>().index )
116+ );
117+ };
118118
119- // helper to avoid error 'index_t': is not a member of T
119+ // helper to avoid error 'index_t': is not a member of T
120120 template <typename T, typename = void >
121121 struct get_index_t {
122122 using type = std::size_t ;
123123 };
124-
125124 template <has_index T>
126125 struct get_index_t <T, std::void_t <typename T::index_t >> {
127126 using type = typename T::index_t ;
0 commit comments