dynamicconverter_detail::is_map<C>::value>::type> {
static dynamic construct(const C& x) {
dynamic d = dynamic::object;
- for (auto& pair : x) {
+ for (const auto& pair : x) {
d.insert(toDynamic(pair.first), toDynamic(pair.second));
}
return d;
dynamicconverter_detail::is_range<C>::value>::type> {
static dynamic construct(const C& x) {
dynamic d = dynamic::array;
- for (auto& item : x) {
+ for (const auto& item : x) {
d.push_back(toDynamic(item));
}
return d;
dynamic::array(3, 4, 5));
EXPECT_EQ(d, toDynamic(c));
}
+
+ {
+ vector<bool> vb{true, false};
+ dynamic d = dynamic::array(true, false);
+ EXPECT_EQ(d, toDynamic(vb));
+ }
}
TEST(DynamicConverter, errors) {