d-led/picojson_serializer — pull request #5 by olafmandel (2014-06-17 14:52:03+00:00)
Title: Handle serialisation of const types 

* Add `is_const` type trait and `remove_const` modifier
* Change all `to_value(T&)` methods to `to_value(T const&)`
* Add `value_converter` partial template specialisation (only provides `to_value()` without `from_value()`)
* Remove obviated hack in `operators::to_value()`

Problem: at two points, uses `const_cast` to remove a `const` qualification before calling user code (either a `json(archive&)` method or a `json(archive&, T&)` free function). These are supposed to only call `archive::operator&(key_value)` which calls only `to_value()`.

There are two ways to accidentally break this:
1. the user can implement a `json()`, either method or free function, that actually modifies the object.
2. the user can implement a `value_converter::to_value()` that modifies the argument

The second problem can probably be addressed by putting more work into `archive::operator&()`, but the first issue requires a change in the interface of the library.

Closes #4