File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1616#include < string>
1717
1818#include " irep.h"
19+ #include " range.h"
1920
2021class json_objectt ;
2122class json_arrayt ;
@@ -175,6 +176,12 @@ class json_arrayt:public jsont
175176 {
176177 }
177178
179+ template <typename iteratort>
180+ explicit json_arrayt (ranget<iteratort> &&range)
181+ : json_arrayt(kindt::J_ARRAY, arrayt{range.begin (), range.end ()})
182+ {
183+ }
184+
178185 void resize (std::size_t size)
179186 {
180187 array.resize (size);
@@ -304,6 +311,12 @@ class json_objectt:public jsont
304311 {
305312 }
306313
314+ template <typename iteratort>
315+ explicit json_objectt (ranget<iteratort> &&range)
316+ : json_objectt(kindt::J_OBJECT, objectt{range.begin (), range.end ()})
317+ {
318+ }
319+
307320 jsont &operator [](const std::string &key)
308321 {
309322 return object[key];
You can’t perform that action at this time.
0 commit comments