Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions include/boost/json/detail/parse_into.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,6 @@ class converting_handler<sequence_conversion_tag, V, P>
return false;
}

inserter = detail::inserter(*value_, inserter_implementation<V>());

return converting_handler::composite_handler::signal_end(ec);
}

Expand All @@ -599,6 +597,7 @@ class converting_handler<sequence_conversion_tag, V, P>

this->inner_active_ = true;
clear_container( *value_, inserter_implementation<V>() );
inserter = detail::inserter(*value_, inserter_implementation<V>());
return true;
}

Expand Down
12 changes: 12 additions & 0 deletions test/parse_into.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <boost/json/serialize.hpp>
#include <boost/json/value_from.hpp>
#include <boost/json/value_to.hpp>
#include <boost/container/flat_set.hpp>
#include <boost/describe.hpp>

#include <climits>
Expand Down Expand Up @@ -326,6 +327,17 @@ class parse_into_test

parse_into(v, "[5,6,7]");
BOOST_TEST( v.size() == 3 );

// containers that are filled through an insert iterator
testParseInto< std::vector<container::flat_set<int>> >(
{ {}, { 1 }, { 2, 3 }, { 4, 5, 6 } } );

container::flat_set<int> s;
parse_into(s, "[1,2,3,4]");
BOOST_TEST( s.size() == 4 );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the significance of this test and the one on line 340 as opposed to the test on line 332?


parse_into(s, "[5,6,7]");
BOOST_TEST( s.size() == 3 );
}

void testMap()
Expand Down
Loading