Skip to content

Commit c9bc41c

Browse files
committed
Fix list of boolean argument
1 parent 757968e commit c9bc41c

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

include/graphqlservice/GraphQLService.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -795,11 +795,18 @@ struct ModifiedArgument
795795
duplicate(const typename ArgumentTraits<Type, Modifier, Other...>::type& listValue)
796796
requires ListModifier<Modifier>
797797
{
798-
typename ArgumentTraits<Type, Modifier, Other...>::type result(listValue.size());
799-
800-
std::ranges::transform(listValue, result.begin(), duplicate<Other...>);
801-
802-
return result;
798+
if constexpr(std::is_same_v<Type,bool>){
799+
typename ArgumentTraits<Type, Modifier, Other...>::type result;
800+
result.reserve(listValue.size());
801+
for (auto const v: listValue)
802+
result.push_back(v);
803+
}
804+
else
805+
{
806+
typename ArgumentTraits<Type, Modifier, Other...>::type result(listValue.size());
807+
std::ranges::transform(listValue, result.begin(), duplicate<Other...>);
808+
return result;
809+
}
803810
}
804811
};
805812

0 commit comments

Comments
 (0)