Skip to content

Commit 06a9abc

Browse files
gitmodimoRafał Hibner
authored and
Rafał Hibner
committed
Fix list of boolean argument
1 parent 9d1cc5d commit 06a9abc

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
@@ -981,11 +981,18 @@ struct ModifiedArgument
981981
duplicate(const typename ArgumentTraits<Type, Modifier, Other...>::type& listValue)
982982
requires ListModifier<Modifier>
983983
{
984-
typename ArgumentTraits<Type, Modifier, Other...>::type result(listValue.size());
985-
986-
std::ranges::transform(listValue, result.begin(), duplicate<Other...>);
987-
988-
return result;
984+
if constexpr(std::is_same_v<Type,bool>){
985+
typename ArgumentTraits<Type, Modifier, Other...>::type result;
986+
result.reserve(listValue.size());
987+
for (auto const v: listValue)
988+
result.push_back(v);
989+
}
990+
else
991+
{
992+
typename ArgumentTraits<Type, Modifier, Other...>::type result(listValue.size());
993+
std::ranges::transform(listValue, result.begin(), duplicate<Other...>);
994+
return result;
995+
}
989996
}
990997
};
991998

0 commit comments

Comments
 (0)