Boost logo

Boost :

Subject: Re: [boost] Interest in a Boost.JSON library?
From: Kirit Sælensminde (kirit.saelensminde_at_[hidden])
Date: 2008-12-21 22:44:50


Mathias Gaunard wrote:
> Kirit Sælensminde wrote:
>>
>> At the moment we use std::vector and std::map with boost::shared_ptr<
>> json > as the value type.
>
> What about cycles?

Not push bikes? :)

The API makes it very hard (but not impossible) to introduce a cycle
into the JSON tree. To do so you would need to create a json::array_t or
json::object_t and then place the same shared_ptr into the right
locations to make the cycle. I could do something so that these types
are not exposed thus making it impossible to introduce a cycle in the
first place.

The unparser makes no attempt to detect a cycle in the tree, but other
operations should work if you do force one in, but you'll likely see odd
behaviour in other places depending on what is going on in the levels of
code above the library.

K


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk