----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/17520/ -----------------------------------------------------------
(Updated Feb. 20, 2014, 8:54 p.m.) Review request for mesos, Benjamin Hindman and Jeff Currier. Changes ------- rebase from master switched back to optional parameter for SFINAE Bugs: https://issues.apache.org/jira/browse/MESOS-939 https://issues.apache.org/jira/browse/https://issues.apache.org/jira/browse/MESOS-939 Repository: mesos-git Description ------- Add JSON::Boolean to stout/json.hpp. If you assign an JSON::Object a bool then it will get coerced into a JSON::Number w/ value of 0.0 or 1.0. This is because JSON::True and JSON::False do not have constructors from bool. The fix is to introduce a common super class, JSON::Boolean, which both JSON::True and JSON::False inherit from. JSON::Boolean has the necessary constructor which takes a bool. However, this leads to ambiguity when assigning a cstring to a JSON::Value, since JSON::String already takes a const char * and a const char * is implicitly convertable to a bool. The solution for that is to rename the variant from JSON::Value to JSON::inner::Variant and to create a new class JSON::Value which inherits from JSON::inner::Variant. The new JSON::Value can have all the conversion constructors in a single place, so is no ambiguity, and delegate everythign else to the Variant. Also added a bunch of unit tests. SEE: https://issues.apache.org/jira/browse/MESOS-939 Review: https://reviews.apache.org/r/17520 Diffs (updated) ----- 3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp 8b64e89e0b10f41878c84939cbb402a101324181 3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp aafaaa6f8c9ac1bd5037ca39983533ab79cae079 Diff: https://reviews.apache.org/r/17520/diff/ Testing ------- make check + new unit tests Thanks, Charlie Carson