</code></pre></div><p>A JSON pointer defines a string syntax for identifying a specific value within a JSON document. It can be used with functions <ahref=../basic_json/at/><code>at</code></a> and <ahref=../basic_json/operator%5B%5D/><code>operator[]</code></a>. Furthermore, JSON pointers are the base for JSON patches.</p><h2id=template-parameters>Template parameters<aclass=headerlinkhref=#template-parameterstitle="Permanent link">¶</a></h2><dl><dt><code>RefStringType</code></dt><dd>the string type used for the reference tokens making up the JSON pointer</dd></dl><divclass="admonition warning"><pclass=admonition-title>Deprecation</p><p>For backwards compatibility <code>RefStringType</code> may also be a specialization of <ahref=../basic_json/><code>basic_json</code></a> in which case <code>string_t</code> will be deduced as <ahref=../basic_json/string_t/><code>basic_json::string_t</code></a>. This feature is deprecated and may be removed in a future major version.</p></div><h2id=member-types>Member types<aclass=headerlinkhref=#member-typestitle="Permanent link">¶</a></h2><ul><li><ahref=string_t/><strong>string_t</strong></a> - the string type used for the reference tokens</li></ul><h2id=member-functions>Member functions<aclass=headerlinkhref=#member-functionstitle="Permanent link">¶</a></h2><ul><li><ahref=json_pointer/>(constructor)</a></li><li><ahref=to_string/><strong>to_string</strong></a> - return a string representation of the JSON pointer</li><li><ahref=operator_string_t/><strong>operator string_t</strong></a> - return a string representation of the JSON pointer</li><li><ahref=operator_eq/><strong>operator==</strong></a> - compare: equal</li><li><ahref=operator_ne/><strong>operator!=</strong></a> - compare: not equal</li><li><ahref=operator_slasheq/><strong>operator/=</strong></a> - append to the end of the JSON pointer</li><li><ahref=operator_slash/><strong>operator/</strong></a> - create JSON Pointer by appending</li><li><ahref=parent_pointer/><strong>parent_pointer</strong></a> - returns the parent of this JSON pointer</li><li><ahref=pop_back/><strong>pop_back</strong></a> - remove last reference token</li><li><ahref=back/><strong>back</strong></a> - return last reference token</li><li><ahref=push_back/><strong>push_back</strong></a> - append an unescaped token at the end of the pointer</li><li><ahref=empty/><strong>empty</strong></a> - return whether pointer points to the root document</li></ul><h2id=literals>Literals<aclass=headerlinkhref=#literalstitle="Permanent link">¶</a></h2><ul><li><ahref=../operator_literal_json_pointer/><strong>operator""_json_pointer</strong></a> - user-defined string literal for JSON pointers</li></ul><h2id=see-also>See also<aclass=headerlinkhref=#see-alsotitle="Permanent link">¶</a></h2><ul><li><ahref=https://datatracker.ietf.org/doc/html/rfc6901>RFC 6901</a></li></ul><h2id=version-history>Version history<aclass=headerlinkhref=#version-historytitle="Permanent link">¶</a></h2><ul><li>Added in version 2.0.0.</li><li>Changed template parameter from <code>basic_json</code> to string type in version 3.11.0.</li></ul><hr><divclass=md-source-file><small> Last update: <spanclass="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">August 5, 2022</span></small></div></article></div><script>vartabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(varsetofdocument.querySelectorAll(".tabbed-set")){vartab,labels=set.querySelector(".tabbed-labels");for(taboftabs)for(varlabeloflabels.getElementsByTagName("label"))if(label.innerText.trim()===tab){varinput=document.getElementById(label.htmlFor);input.checked=!0;continuee}}</script></div><ahref=#class="md-top md-icon"data-md-component=tophidden><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12Z"/></svg> Back to top </a></main><footerclass=md-footer><navclass="md-footer__innermd