@@ -168,9 +168,16 @@ struct ModifiedVariable
168
168
response::Value result { response::Type::List };
169
169
170
170
result.reserve (listValue.size ());
171
- std::ranges::for_each (listValue, [&result](auto & value) {
172
- result.emplace_back (serialize<Other...>(std::move (value)));
173
- });
171
+ if constexpr (std::is_same_v<Type,bool >){
172
+ for (auto const v: listValue)
173
+ result.emplace_back (Variable<bool >::serialize (bool {v}));
174
+ }
175
+ else {
176
+ std::ranges::for_each (listValue, [&result](auto & value) {
177
+ result.emplace_back (serialize<Other...>(std::move (value)));
178
+ });
179
+ }
180
+
174
181
listValue.clear ();
175
182
176
183
return result;
@@ -217,11 +224,19 @@ struct ModifiedVariable
217
224
duplicate (const typename VariableTraits<Type, Modifier, Other...>::type& listValue)
218
225
requires ListModifier<Modifier>
219
226
{
220
- typename VariableTraits<Type, Modifier, Other...>::type result (listValue.size ());
221
-
222
- std::ranges::transform (listValue, result.begin (), duplicate<Other...>);
223
-
224
- return result;
227
+ if constexpr (std::is_same_v<Type,bool >){
228
+ typename VariableTraits<Type, Modifier, Other...>::type result;
229
+ result.reserve (listValue.size ());
230
+ for (auto const v: listValue)
231
+ result.push_back (v);
232
+ return result;
233
+ }
234
+ else
235
+ {
236
+ typename VariableTraits<Type, Modifier, Other...>::type result (listValue.size ());
237
+ std::ranges::transform (listValue, result.begin (), duplicate<Other...>);
238
+ return result;
239
+ }
225
240
}
226
241
};
227
242
0 commit comments