cinder/Cinder — pull request #193 by reakinator (2012-07-20 01:47:08+00:00)
Title: Boost container

This pull request changes the underlining container type of XmlTree and JsonTree to be boost::container::list. It also typedefs the container, so that it can be easily changed at a later type. It also typedefs the container so that it can easily be changed at a later time.

##### Background

As discussed on the [dev forum][post], the stl containers have become stricter concerning incomplete types
in C++11. In particular, C++11 §17.6.4.8 [lib.res.on.functions], "requirements on other functions" states:

```
In particular, the effects are undefined in the following cases:
...

if an incomplete type (3.9) is used as a template argument when instantiating a template component,
unless specifically allowed for that component.
```

With this liberty, libc++ has already added compile time checks for the stl containers so that they cannot use incomplete types. As this can at any time also occur with any C++11 compliant compiler, it is best to choose a container that supports this feature for XmlTree and JsonTree, as they depend on this recursive structure that has already been forbidden in libc++.

##### Discussion

It was mentioned that boost::container::slist can be a more efficient choice container, but when switching to it I noticed that alot of the interface no longer makes sense, since they declare a couple methods as pushBack / push_back. This isn't accurate with slist since it is a forward traversing container at it only makes sense to push to its front. I think that if this is to be used, the interface should be generalized, which could potentially break existing code so I have left it alone until further discussion.

The naming of the typedefed container (`typdef boost::container::list container`) is a bit arbitrary, I'm horrible at naming things. I also thought of 'collection', or 'list_type' (since it appears that these containers must use some sort of list for a subtree container), but I think it should be named whatever the reviewer thinks fits best with the library.

##### Related Changes

- Files programmed in windows are marked in Xcode with windows line endings, so they are not completely marked up when edited in Xcode
- Updated the JsonTest and XmlTest apps for OS X:
- deployment and sdk versions
- fs::path's operator=/ for Json file append

[post]: https://forum.libcinder.org/topic/supporting-the-c-11-standard-and-libc-os-x