@@ -591,15 +591,14 @@ enum class TypeModifier
591591 List,
592592};
593593
594+ // Used by ModifiedArgument to special-case an innermost nullable INPUT_OBJECT type.
595+ template <TypeModifier... Other>
596+ constexpr bool onlyNoneModifiers = (... && (Other == TypeModifier::None));
597+
598+ // Specialized as true for all INPUT_OBJECT types.
594599template <typename Type>
595600constexpr bool isInputType = false ;
596601
597- template <TypeModifier Modifier>
598- constexpr bool isNoneModifier = (Modifier == TypeModifier::None);
599-
600- template <TypeModifier... Other>
601- constexpr bool trailingNoneModifiers = (... && isNoneModifer<Other>);
602-
603602// Extract individual arguments with chained type modifiers which add nullable or list wrappers.
604603// If the argument is not optional, use require and let it throw a schema_exception when the
605604// argument is missing or not the correct type. If it's optional, use find and check the second
@@ -613,7 +612,7 @@ struct ModifiedArgument
613612 {
614613 // Peel off modifiers until we get to the underlying type.
615614 using type = typename std::conditional_t <TypeModifier::Nullable == Modifier,
616- typename std::conditional_t <isInputType<U> && trailingNoneModifiers <Other...>,
615+ typename std::conditional_t <isInputType<U> && onlyNoneModifiers <Other...>,
617616 std::unique_ptr<U>, std::optional<typename ArgumentTraits<U, Other...>::type>>,
618617 typename std::conditional_t <TypeModifier::List == Modifier,
619618 std::vector<typename ArgumentTraits<U, Other...>::type>, U>>;
@@ -693,7 +692,7 @@ struct ModifiedArgument
693692
694693 auto result = require<Other...>(name, arguments);
695694
696- if constexpr (isInputType<Type> && trailingNoneModifiers <Other...>)
695+ if constexpr (isInputType<Type> && onlyNoneModifiers <Other...>)
697696 {
698697 return std::make_unique<decltype (result)>(std::move (result));
699698 }
0 commit comments