miloyip/rapidjson — pull request #107 by pah (2014-08-20 05:23:14+00:00)
Title: GenericValue: add optional support for std::string

Some users want to use RapidJSON with `std::string` objects. This pull-request adds an (opt-in) feature to include some basic support. The implementation uses `std::basic_string` as generic string type.

`GenericValue`'s string support currently covers:
* construction / `SetString`
* comparison

No special APIs for `AddMember` or `PushBack` have been added, as `std::string` most probably requires copying (or an explicit StringRef() call). Using the `GenericValue` constructor should be sufficient:
````cpp
std::string str;
d.AddMember("string", Value(str, d.GetAllocator()).Move(), d.GetAllocator());
````

The functionality needs to be enabled by defining `RAPIDJSON_HAS_STDSTRING`. The Travis CI config has been updated to add this define by default to include the tests.

Last, but not least, the comparison operators have been refactored to simplify the addition of new overloads (see 702b45b). With the new forwarding structure, only a single function needs to be added to extend the comparison support.