MCPcopy Create free account
hub / github.com/bupticybee/TexasSolver / array_index

Method array_index

include/json.hpp:10404–10416  ·  view source on GitHub ↗

! @param[in] s reference token to be converted into an array index @return integer representation of @a s @throw out_of_range.404 if string @a s could not be converted to an integer */

Source from the content-addressed store, hash-verified

10402 @throw out_of_range.404 if string @a s could not be converted to an integer
10403 */
10404 static int array_index(const std::string& s)
10405 {
10406 std::size_t processed_chars = 0;
10407 const int res = std::stoi(s, &processed_chars);
10408
10409 // check if the string was completely read
10410 if (JSON_HEDLEY_UNLIKELY(processed_chars != s.size()))
10411 {
10412 JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'"));
10413 }
10414
10415 return res;
10416 }
10417
10418 json_pointer top() const
10419 {

Callers

nothing calls this directly

Calls 2

createFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected