1 # <small>nlohmann::basic_json::</small>operator""_json
4 json operator "" _json(const char* s, std::size_t n);
7 This operator implements a user-defined string literal for JSON objects. It can be used by adding `#!cpp _json` to a
8 string literal and returns a [`json`](../json.md) object if no parse error occurred.
13 : a string representation of a JSON object
16 : length of string `s`
20 [`json`](../json.md) value parsed from `s`
24 The function can throw anything that [`parse(s, s+n)`](parse.md) would throw.
34 The following code shows how to create JSON values from string literals.
37 --8<-- "examples/operator_literal_json.cpp"
43 --8<-- "examples/operator_literal_json.output"
48 - Added in version 1.0.0.