Skip to content

Commit 7952633

Browse files
committed
Use a static_assert for the None modifier in ModifiedArgument too
1 parent 29eeba4 commit 7952633

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/graphqlservice/GraphQLService.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,9 +663,11 @@ struct ModifiedArgument
663663

664664
// Peel off the none modifier. If it's included, it should always be last in the list.
665665
template <TypeModifier Modifier = TypeModifier::None, TypeModifier... Other>
666-
static typename std::enable_if_t<TypeModifier::None == Modifier && sizeof...(Other) == 0, Type>
667-
require(std::string_view name, const response::Value& arguments)
666+
static typename std::enable_if_t<TypeModifier::None == Modifier, Type> require(
667+
std::string_view name, const response::Value& arguments)
668668
{
669+
static_assert(sizeof...(Other) == 0, "None modifier should always be last");
670+
669671
// Just call through to the non-template method without the modifiers.
670672
return require(name, arguments);
671673
}

0 commit comments

Comments
 (0)