File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -569,10 +569,23 @@ struct ModifiedResult
569
569
570
570
wrappedParams.errorPath .push (size_t { 0 });
571
571
572
- for ( auto & entry : wrappedResult)
572
+ if constexpr (!std::is_reference_v< typename std:: decay_t < decltype ( wrappedResult)>::reference> )
573
573
{
574
- children.push (convert<Other...>(std::move (entry), ResolverParams (wrappedParams)));
575
- ++std::get<size_t >(wrappedParams.errorPath .back ());
574
+ // Special handling for std::vector<> specializations which don't return a reference to the underlying type,
575
+ // i.e. std::vector<bool> on many platforms. Copy the values from the std::vector<> rather than moving them.
576
+ for (auto entry : wrappedResult)
577
+ {
578
+ children.push (convert<Other...>(entry, ResolverParams (wrappedParams)));
579
+ ++std::get<size_t >(wrappedParams.errorPath .back ());
580
+ }
581
+ }
582
+ else
583
+ {
584
+ for (auto & entry : wrappedResult)
585
+ {
586
+ children.push (convert<Other...>(std::move (entry), ResolverParams (wrappedParams)));
587
+ ++std::get<size_t >(wrappedParams.errorPath .back ());
588
+ }
576
589
}
577
590
578
591
response::Value data (response::Type::List);
You can’t perform that action at this time.
0 commit comments