1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-09 11:01:47 +03:00

started to implement sequence container

This commit is contained in:
Niels
2015-04-12 12:02:30 +02:00
parent 02f617f083
commit b801adca76
5 changed files with 125 additions and 3 deletions

View File

@ -156,7 +156,7 @@ class basic_json
/// returns the allocator associated with the container
inline allocator_type get_allocator() const
inline static allocator_type get_allocator()
{
return allocator_type();
}
@ -578,6 +578,14 @@ class basic_json
return basic_json(l, false, value_t::object);
}
/// construct an array with count copies of given value
inline basic_json(size_type count, const basic_json& other)
: m_type(value_t::array)
{
AllocatorType<array_t> alloc;
m_value.array = alloc.allocate(1);
alloc.construct(m_value.array, count, other);
}
///////////////////////////////////////
// other constructors and destructor //