Skip to content

Commit e369d45

Browse files
committed
Fix non-compileable examples
1 parent 0c9dc11 commit e369d45

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

include/simdjson/dom/array.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class array {
6868
* Get the value associated with the given JSON pointer.
6969
*
7070
* dom::parser parser;
71-
* array a = parser.parse(R"([ { "foo": { "a": [ 10, 20, 30 ] }} ])");
71+
* array a = parser.parse(R"([ { "foo": { "a": [ 10, 20, 30 ] }} ])"_padded);
7272
* a.at("0/foo/a/1") == 20
7373
* a.at("0")["foo"]["a"].at(1) == 20
7474
*

include/simdjson/dom/element.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ class element {
336336
* The key will be matched against **unescaped** JSON:
337337
*
338338
* dom::parser parser;
339-
* parser.parse(R"({ "a\n": 1 })")["a\n"].get<uint64_t>().first == 1
340-
* parser.parse(R"({ "a\n": 1 })")["a\\n"].get<uint64_t>().error() == NO_SUCH_FIELD
339+
* parser.parse(R"({ "a\n": 1 })"_padded)["a\n"].get<uint64_t>().first == 1
340+
* parser.parse(R"({ "a\n": 1 })"_padded)["a\\n"].get<uint64_t>().error() == NO_SUCH_FIELD
341341
*
342342
* @return The value associated with this field, or:
343343
* - NO_SUCH_FIELD if the field does not exist in the object
@@ -351,8 +351,8 @@ class element {
351351
* The key will be matched against **unescaped** JSON:
352352
*
353353
* dom::parser parser;
354-
* parser.parse(R"({ "a\n": 1 })")["a\n"].get<uint64_t>().first == 1
355-
* parser.parse(R"({ "a\n": 1 })")["a\\n"].get<uint64_t>().error() == NO_SUCH_FIELD
354+
* parser.parse(R"({ "a\n": 1 })"_padded)["a\n"].get<uint64_t>().first == 1
355+
* parser.parse(R"({ "a\n": 1 })"_padded)["a\\n"].get<uint64_t>().error() == NO_SUCH_FIELD
356356
*
357357
* @return The value associated with this field, or:
358358
* - NO_SUCH_FIELD if the field does not exist in the object
@@ -364,7 +364,7 @@ class element {
364364
* Get the value associated with the given JSON pointer.
365365
*
366366
* dom::parser parser;
367-
* element doc = parser.parse(R"({ "foo": { "a": [ 10, 20, 30 ] }})");
367+
* element doc = parser.parse(R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded);
368368
* doc.at("/foo/a/1") == 20
369369
* doc.at("/")["foo"]["a"].at(1) == 20
370370
* doc.at("")["foo"]["a"].at(1) == 20
@@ -391,8 +391,8 @@ class element {
391391
* The key will be matched against **unescaped** JSON:
392392
*
393393
* dom::parser parser;
394-
* parser.parse(R"({ "a\n": 1 })")["a\n"].get<uint64_t>().first == 1
395-
* parser.parse(R"({ "a\n": 1 })")["a\\n"].get<uint64_t>().error() == NO_SUCH_FIELD
394+
* parser.parse(R"({ "a\n": 1 })"_padded)["a\n"].get<uint64_t>().first == 1
395+
* parser.parse(R"({ "a\n": 1 })"_padded)["a\\n"].get<uint64_t>().error() == NO_SUCH_FIELD
396396
*
397397
* @return The value associated with this field, or:
398398
* - NO_SUCH_FIELD if the field does not exist in the object

include/simdjson/dom/object.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ class object {
101101
* The key will be matched against **unescaped** JSON:
102102
*
103103
* dom::parser parser;
104-
* parser.parse(R"({ "a\n": 1 })")["a\n"].get<uint64_t>().first == 1
105-
* parser.parse(R"({ "a\n": 1 })")["a\\n"].get<uint64_t>().error() == NO_SUCH_FIELD
104+
* parser.parse(R"({ "a\n": 1 })"_padded)["a\n"].get<uint64_t>().first == 1
105+
* parser.parse(R"({ "a\n": 1 })"_padded)["a\\n"].get<uint64_t>().error() == NO_SUCH_FIELD
106106
*
107107
* This function has linear-time complexity: the keys are checked one by one.
108108
*
@@ -118,8 +118,8 @@ class object {
118118
* The key will be matched against **unescaped** JSON:
119119
*
120120
* dom::parser parser;
121-
* parser.parse(R"({ "a\n": 1 })")["a\n"].get<uint64_t>().first == 1
122-
* parser.parse(R"({ "a\n": 1 })")["a\\n"].get<uint64_t>().error() == NO_SUCH_FIELD
121+
* parser.parse(R"({ "a\n": 1 })"_padded)["a\n"].get<uint64_t>().first == 1
122+
* parser.parse(R"({ "a\n": 1 })"_padded)["a\\n"].get<uint64_t>().error() == NO_SUCH_FIELD
123123
*
124124
* This function has linear-time complexity: the keys are checked one by one.
125125
*
@@ -133,7 +133,7 @@ class object {
133133
* Get the value associated with the given JSON pointer.
134134
*
135135
* dom::parser parser;
136-
* object obj = parser.parse(R"({ "foo": { "a": [ 10, 20, 30 ] }})");
136+
* object obj = parser.parse(R"({ "foo": { "a": [ 10, 20, 30 ] }})"_padded);
137137
* obj.at("foo/a/1") == 20
138138
* obj.at("foo")["a"].at(1) == 20
139139
*
@@ -151,8 +151,8 @@ class object {
151151
* The key will be matched against **unescaped** JSON:
152152
*
153153
* dom::parser parser;
154-
* parser.parse(R"({ "a\n": 1 })")["a\n"].get<uint64_t>().first == 1
155-
* parser.parse(R"({ "a\n": 1 })")["a\\n"].get<uint64_t>().error() == NO_SUCH_FIELD
154+
* parser.parse(R"({ "a\n": 1 })"_padded)["a\n"].get<uint64_t>().first == 1
155+
* parser.parse(R"({ "a\n": 1 })"_padded)["a\\n"].get<uint64_t>().error() == NO_SUCH_FIELD
156156
*
157157
* This function has linear-time complexity: the keys are checked one by one.
158158
*

0 commit comments

Comments
 (0)