Closed nlohmann closed 7 years ago
First: thank you for the spelling corrections, at least some mistakes are consistently ;-)
Discussion points:
Order of enumeration json_type
: the old order was increasing complexity of the data. Similarity to python is also OK. Personally, I have no preference.
Equality of floating point numbers: maybe the equality could be formulated as the difference must be smaller or equal to std::numeric_limits<T>::epsilon()
. The construction should catch inf
and NAN
, to prevent the necessity of checks in comparisons. They are forbidden by JSON anyway. Any thoughts?
front()
and back()
: indeed begin()/end()
have constant complexity, so could front()
. Depending on "special" implementations of containers, back()
could be more complex than end()
, e.g. trees. But since both, front()
and back()
rely on the underlying type, I think there cannot be other guarantees made by basic_json.
clear()
to default construct with the same type: semantics, points could be made for both positions... Since the proposal is based on nlomann/json, let's go with it's behavior.
Regarding https://github.com/nlohmann/std_json/pull/10#issuecomment-324148502:
operator==
overload.I suggest to merge and keep nlohmann/json#703 as an open issue.
A lot of small comments and edits. I also added some TODOs to discuss some things.
I have some more remarks beginning in the section where
push_back
is defined. I shall add them tomorrow.