16 Sep
2020
16 Sep
'20
3:39 p.m.
On Wed, Sep 16, 2020 at 8:20 AM Peter Dimov
If json::array supported internally arrays of scalars, without changing its interface at all so it still appeared to clients as a json::array of json::values, we could represent a binary value as a json::array (which internally uses a scalar type of unsigned char.)
That is easy to say but what do you do about this function which returns a reference: inline value& array::operator[]( std::size_t pos ) noexcept; What do you do if you have an array of int (scalar) and someone accesses an element in the middle and assigns a string to it? Thanks