@@ -134,7 +134,8 @@ constexpr std::string_view strSubscription { "subscription"sv };
134134} // namespace keywords
135135
136136// Resolvers may be called in multiple different Operation contexts.
137- enum class [[nodiscard]] ResolverContext {
137+ enum class [[nodiscard]] ResolverContext
138+ {
138139 // Resolving a Query operation.
139140 Query,
140141
@@ -197,7 +198,7 @@ class [[nodiscard]] await_async final
197198 template <class T >
198199 struct [[nodiscard]] Model : Concept
199200 {
200- Model (std::shared_ptr<T>&& pimpl)
201+ explicit Model (std::shared_ptr<T> pimpl) noexcept
201202 : _pimpl { std::move (pimpl) }
202203 {
203204 }
@@ -226,7 +227,7 @@ class [[nodiscard]] await_async final
226227public:
227228 // Type-erased explicit constructor for a custom awaitable.
228229 template <class T >
229- explicit await_async (std::shared_ptr<T> pimpl)
230+ explicit await_async (std::shared_ptr<T> pimpl) noexcept
230231 : _pimpl { std::make_shared<Model<T>>(std::move (pimpl)) }
231232 {
232233 }
@@ -586,7 +587,8 @@ using ResolverMap = internal::string_view_map<Resolver>;
586587// GraphQL types are nullable by default, but they may be wrapped with non-null or list types.
587588// Since nullability is a more special case in C++, we invert the default and apply that modifier
588589// instead when the non-null wrapper is not present in that part of the wrapper chain.
589- enum class [[nodiscard]] TypeModifier {
590+ enum class [[nodiscard]] TypeModifier
591+ {
590592 None,
591593 Nullable,
592594 List,
@@ -598,11 +600,13 @@ concept OnlyNoneModifiers = (... && (Other == TypeModifier::None));
598600
599601// Test if the next modifier is Nullable.
600602template <TypeModifier Modifier>
601- concept NullableModifier = Modifier == TypeModifier::Nullable;
603+ concept NullableModifier = Modifier ==
604+ TypeModifier::Nullable;
602605
603606// Test if the next modifier is List.
604607template <TypeModifier Modifier>
605- concept ListModifier = Modifier == TypeModifier::List;
608+ concept ListModifier = Modifier ==
609+ TypeModifier::List;
606610
607611// Convert arguments and input types with a non-templated static method.
608612template <typename Type>
@@ -634,12 +638,13 @@ namespace {
634638
635639// These types are used as scalar arguments even though they are represented with a class.
636640template <typename Type>
637- concept ScalarArgumentClass = std::is_same_v<Type, std::string> || std::is_same_v<Type,
638- response::IdType> || std::is_same_v<Type, response::Value>;
641+ concept ScalarArgumentClass = std::is_same_v<Type, std::string>
642+ || std::is_same_v<Type, response::IdType> || std::is_same_v<Type, response::Value>;
639643
640644// Any non-scalar class used in an argument is a generated INPUT_OBJECT type.
641645template <typename Type>
642- concept InputArgumentClass = std::is_class_v<Type> && !ScalarArgumentClass<Type>;
646+ concept InputArgumentClass = std::is_class_v<Type> && !
647+ ScalarArgumentClass<Type>;
643648
644649// Special-case an innermost nullable INPUT_OBJECT type.
645650template <typename Type, TypeModifier... Other>
@@ -710,8 +715,8 @@ struct ModifiedArgument
710715
711716 // Peel off the none modifier. If it's included, it should always be last in the list.
712717 template <TypeModifier Modifier = TypeModifier::None, TypeModifier... Other>
713- [[nodiscard]] static Type require (std::string_view name,
714- const response::Value& arguments) requires OnlyNoneModifiers<Modifier, Other...>
718+ [[nodiscard]] static Type require (std::string_view name, const response::Value& arguments)
719+ requires OnlyNoneModifiers<Modifier, Other...>
715720 {
716721 static_assert (sizeof ...(Other) == 0 , " None modifier should always be last" );
717722
@@ -722,7 +727,8 @@ struct ModifiedArgument
722727 // Peel off nullable modifiers.
723728 template <TypeModifier Modifier, TypeModifier... Other>
724729 [[nodiscard]] static typename ArgumentTraits<Type, Modifier, Other...>::type require (
725- std::string_view name, const response::Value& arguments) requires NullableModifier<Modifier>
730+ std::string_view name, const response::Value& arguments)
731+ requires NullableModifier<Modifier>
726732 {
727733 const auto & valueItr = arguments.find (name);
728734
@@ -747,7 +753,8 @@ struct ModifiedArgument
747753 // Peel off list modifiers.
748754 template <TypeModifier Modifier, TypeModifier... Other>
749755 [[nodiscard]] static typename ArgumentTraits<Type, Modifier, Other...>::type require (
750- std::string_view name, const response::Value& arguments) requires ListModifier<Modifier>
756+ std::string_view name, const response::Value& arguments)
757+ requires ListModifier<Modifier>
751758 {
752759 const auto & values = arguments[name];
753760 typename ArgumentTraits<Type, Modifier, Other...>::type result (values.size ());
@@ -784,8 +791,8 @@ struct ModifiedArgument
784791
785792 // Peel off the none modifier. If it's included, it should always be last in the list.
786793 template <TypeModifier Modifier = TypeModifier::None, TypeModifier... Other>
787- [[nodiscard]] static Type duplicate (
788- const Type& value) requires OnlyNoneModifiers<Modifier, Other...>
794+ [[nodiscard]] static Type duplicate (const Type& value)
795+ requires OnlyNoneModifiers<Modifier, Other...>
789796 {
790797 // Just copy the value.
791798 return Type { value };
@@ -794,8 +801,8 @@ struct ModifiedArgument
794801 // Peel off nullable modifiers.
795802 template <TypeModifier Modifier, TypeModifier... Other>
796803 [[nodiscard]] static typename ArgumentTraits<Type, Modifier, Other...>::type duplicate (
797- const typename ArgumentTraits<Type, Modifier, Other...>::type& nullableValue) requires
798- NullableModifier<Modifier>
804+ const typename ArgumentTraits<Type, Modifier, Other...>::type& nullableValue)
805+ requires NullableModifier<Modifier>
799806 {
800807 typename ArgumentTraits<Type, Modifier, Other...>::type result {};
801808
@@ -818,8 +825,8 @@ struct ModifiedArgument
818825 // Peel off list modifiers.
819826 template <TypeModifier Modifier, TypeModifier... Other>
820827 [[nodiscard]] static typename ArgumentTraits<Type, Modifier, Other...>::type duplicate (
821- const typename ArgumentTraits<Type, Modifier, Other...>::type& listValue) requires
822- ListModifier<Modifier>
828+ const typename ArgumentTraits<Type, Modifier, Other...>::type& listValue)
829+ requires ListModifier<Modifier>
823830 {
824831 typename ArgumentTraits<Type, Modifier, Other...>::type result (listValue.size ());
825832
@@ -943,7 +950,8 @@ concept ObjectType = std::is_same_v<Object, Type>;
943950
944951// Test if this Type inherits from Object but is not Object itself.
945952template <typename Type>
946- concept ObjectDerivedType = ObjectBaseType<Type> && !ObjectType<Type>;
953+ concept ObjectDerivedType = ObjectBaseType<Type> && !
954+ ObjectType<Type>;
947955
948956// Test if a nullable type is std::shared_ptr<Type> or std::optional<T>.
949957template <typename Type, TypeModifier... Other>
@@ -957,7 +965,8 @@ concept NoneObjectDerivedType = OnlyNoneModifiers<Modifier> && ObjectDerivedType
957965// Test all other result types to see if they should call the specialized convert method without
958966// template parameters.
959967template <typename Type, TypeModifier Modifier>
960- concept NoneScalarOrObjectType = OnlyNoneModifiers<Modifier> && !ObjectDerivedType<Type>;
968+ concept NoneScalarOrObjectType = OnlyNoneModifiers<Modifier> && !
969+ ObjectDerivedType<Type>;
961970
962971// Test if this method should return a nullable std::shared_ptr<Type>
963972template <typename Type, TypeModifier Modifier, TypeModifier... Other>
@@ -1001,8 +1010,8 @@ struct ModifiedResult
10011010 // Peel off the none modifier. If it's included, it should always be last in the list.
10021011 template <TypeModifier Modifier = TypeModifier::None, TypeModifier... Other>
10031012 [[nodiscard]] static AwaitableResolver convert (
1004- AwaitableObject<typename ResultTraits<Type>::type> result,
1005- ResolverParams params) requires NoneObjectDerivedType<Type, Modifier>
1013+ AwaitableObject<typename ResultTraits<Type>::type> result, ResolverParams params)
1014+ requires NoneObjectDerivedType<Type, Modifier>
10061015 {
10071016 // Call through to the Object specialization with a static_pointer_cast for subclasses of
10081017 // Object.
@@ -1021,8 +1030,9 @@ struct ModifiedResult
10211030
10221031 // Peel off the none modifier. If it's included, it should always be last in the list.
10231032 template <TypeModifier Modifier = TypeModifier::None, TypeModifier... Other>
1024- [[nodiscard]] static AwaitableResolver convert (typename ResultTraits<Type>::future_type result,
1025- ResolverParams params) requires NoneScalarOrObjectType<Type, Modifier>
1033+ [[nodiscard]] static AwaitableResolver convert (
1034+ typename ResultTraits<Type>::future_type result, ResolverParams params)
1035+ requires NoneScalarOrObjectType<Type, Modifier>
10261036 {
10271037 static_assert (sizeof ...(Other) == 0 , " None modifier should always be last" );
10281038
@@ -1033,8 +1043,8 @@ struct ModifiedResult
10331043 // Peel off final nullable modifiers for std::shared_ptr of Object and subclasses of Object.
10341044 template <TypeModifier Modifier, TypeModifier... Other>
10351045 [[nodiscard]] static AwaitableResolver convert (
1036- typename ResultTraits<Type, Modifier, Other...>::future_type result,
1037- ResolverParams params) requires NullableResultSharedPtr<Type, Modifier, Other...>
1046+ typename ResultTraits<Type, Modifier, Other...>::future_type result, ResolverParams params)
1047+ requires NullableResultSharedPtr<Type, Modifier, Other...>
10381048 {
10391049 co_await params.launch ;
10401050
@@ -1054,8 +1064,8 @@ struct ModifiedResult
10541064 // Peel off nullable modifiers for anything else, which should all be std::optional.
10551065 template <TypeModifier Modifier, TypeModifier... Other>
10561066 [[nodiscard]] static AwaitableResolver convert (
1057- typename ResultTraits<Type, Modifier, Other...>::future_type result,
1058- ResolverParams params) requires NullableResultOptional<Type, Modifier, Other...>
1067+ typename ResultTraits<Type, Modifier, Other...>::future_type result, ResolverParams params)
1068+ requires NullableResultOptional<Type, Modifier, Other...>
10591069 {
10601070 static_assert (std::is_same_v<std::optional<typename ResultTraits<Type, Other...>::type>,
10611071 typename ResultTraits<Type, Modifier, Other...>::type>,
@@ -1091,8 +1101,8 @@ struct ModifiedResult
10911101 // Peel off list modifiers.
10921102 template <TypeModifier Modifier, TypeModifier... Other>
10931103 [[nodiscard]] static AwaitableResolver convert (
1094- typename ResultTraits<Type, Modifier, Other...>::future_type result,
1095- ResolverParams params) requires ListModifier<Modifier>
1104+ typename ResultTraits<Type, Modifier, Other...>::future_type result, ResolverParams params)
1105+ requires ListModifier<Modifier>
10961106 {
10971107 if constexpr (!ObjectBaseType<Type>)
10981108 {
@@ -1192,8 +1202,8 @@ struct ModifiedResult
11921202
11931203 // Peel off the none modifier. If it's included, it should always be last in the list.
11941204 template <TypeModifier Modifier = TypeModifier::None, TypeModifier... Other>
1195- static void validateScalar (
1196- const response::Value& value) requires OnlyNoneModifiers<Modifier, Other...>
1205+ static void validateScalar (const response::Value& value)
1206+ requires OnlyNoneModifiers<Modifier, Other...>
11971207 {
11981208 static_assert (sizeof ...(Other) == 0 , " None modifier should always be last" );
11991209
@@ -1203,7 +1213,8 @@ struct ModifiedResult
12031213
12041214 // Peel off nullable modifiers.
12051215 template <TypeModifier Modifier, TypeModifier... Other>
1206- static void validateScalar (const response::Value& value) requires NullableModifier<Modifier>
1216+ static void validateScalar (const response::Value& value)
1217+ requires NullableModifier<Modifier>
12071218 {
12081219 if (value.type () != response::Type::Null)
12091220 {
@@ -1213,7 +1224,8 @@ struct ModifiedResult
12131224
12141225 // Peel off list modifiers.
12151226 template <TypeModifier Modifier, TypeModifier... Other>
1216- static void validateScalar (const response::Value& value) requires ListModifier<Modifier>
1227+ static void validateScalar (const response::Value& value)
1228+ requires ListModifier<Modifier>
12171229 {
12181230 if (value.type () != response::Type::List)
12191231 {
0 commit comments