wamp::Json::encode currently relies on std::snprintf to encode numbers to JSON. If NaN or +/-Infinity is passed to the encoder, it will be serialized as nan and inf/infinity, according to the fprintf documentation.
Unfortunately, JSON does not support encoding of these special values, as raised in this SO question.
wamp::Json::encode should therefore recognize these special values, and encode them as null.
wamp::Json::encode
currently relies onstd::snprintf
to encode numbers to JSON. If NaN or +/-Infinity is passed to the encoder, it will be serialized asnan
andinf
/infinity
, according to thefprintf
documentation.Unfortunately, JSON does not support encoding of these special values, as raised in this SO question.
wamp::Json::encode
should therefore recognize these special values, and encode them asnull
.