JSON Voorhees
Killer JSON for C++
|
Explicit specialization of std::hash
for jsonv::value
types so you can store a value
in an unordered container.
More...
#include <jsonv/value.hpp>
Public Member Functions | |
std::size_t | operator() (const jsonv::value &val) const noexcept |
Explicit specialization of std::hash
for jsonv::value
types so you can store a value
in an unordered container.
Hashing results depend on the kind
for the provided value – most kinds directly use the hasher for their kind (hashing a jsonv::value
for integer 5
should have the same hash value as directly hashing the same integer). For aggregate kinds array
and object
, hashing visits every sub-element recursively. This might be expensive, but is required when storing multiple values with similar layouts in the a set (which is the most common use case).