<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="">= Quick Look Here we highlight important features through example code to help convey the style of the interface. We begin by including the library header file which brings all the symbols into scope. Alternatively, individual headers may be included to obtain the declarations for specific types:</string>
    <string name="">In order to link your program you will need to link with a built library. Alternatively you can use the header-only configuration simply by including this header file in any __one__ of your new or existing source files:</string>
    <string name="">Values</string>
    <string name="">Say you want to recreate this JSON object in a container:</string>
    <string name="">In this library the types &lt;&lt;ref_array&gt;&gt;, &lt;&lt;ref_object&gt;&gt;, and &lt;&lt;ref_string&gt;&gt; hold JSON arrays, objects, and strings respectively while the type &lt;&lt;ref_value&gt;&gt; is a special variant which can hold any JSON element. Here we construct an empty object and then insert the elements above:</string>
    <string name="">While keys are strings, the mapped type of objects and the element type of arrays is the aforementioned type &lt;&lt;ref_value&gt;&gt; which can hold any JSON element, as seen in the previous assignments. Instead of building the JSON document using a series of function calls, we can build it in one statement using an initializer list:</string>
    <string name="">When a &lt;&lt;ref_value&gt;&gt;, &lt;&lt;ref_array&gt;&gt;, or &lt;&lt;ref_object&gt;&gt; is assigned or constructed from an initializer list, the creation of the new value happens only once. This makes initializer lists equally efficient as using the other ways to create a value. The types in this library are first-class, supporting copy and move construction and assignment:</string>
    <string name="">Allocators</string>
    <string name="">To permit custom memory allocation strategies, these containers all allow construction with a &lt;&lt;ref_storage_ptr&gt;&gt; which is a smart pointer to a {ref_memory_resource}. The constructor signatures have the same ordering as their `std` equivalents which use {req_Allocator} parameters. Once a container is constructed its memory resource can never change. Here we create an array without performing any dynamic allocations:</string>
    <string name="">The containers in this library enforce the invariant that every element of the container will use the same memory resource:</string>
    <string name="">When a library type is used as the element type of a PMR container; that is, a container which uses a {ref_polymorphic_allocator}, the memory resource will automatically propagate to the type and all of its children:</string>
    <string name="">Up until now we have shown how values may be constructed from a memory resource pointer, where ownership is not transferred. In this case the caller is responsible for ensuring that the lifetime of the resource is extended for the life of the container. Sometimes you want the container to acquire shared ownership of the resource. This is accomplished with &lt;&lt;ref_make_shared_resource&gt;&gt;:</string>
    <string name="">A counted memory resource will not be destroyed until every container with shared ownership of the resource is destroyed.</string>
    <string name="">Parsing</string>
    <string name="">JSON can be parsed into the value container in one step using a free function. In the following snippet, a parse error is indicated by a thrown exception:</string>
    <string name="">Error codes are also possible:</string>
    <string name="">By default, the parser is strict and only accepts JSON compliant with the standard. However this behavior can be relaxed by filling out an options structure enabling one or more extensions. Here we use a static buffer and enable two non-standard extensions:</string>
    <string name="">The parser in this library implements a https://en.wikipedia.org/wiki/Online_algorithm[__streaming algorithm__]; it can process JSON piece-by-piece, without the requirement that the entire input is available from the start. The parser uses a temporary memory allocation to do its work. If you plan on parsing multiple JSONs, for example in a network server, keeping the same parser instance will allow re-use of this temporary storage, improving performance.</string>
    <string name="">With strategic use of the right memory resources, parser instance, and calculated upper limits on buffer sizes, it is possible to parse and examine JSON without __any__ dynamic memory allocations. This is explored in more detail in a later section.</string>
    <string name="">Serializing</string>
    <string name="">Simple free functions are provided for serializing a &lt;&lt;ref_value&gt;&gt; to a {std_string} containing JSON:</string>
    <string name="">The serializer in this library implements a https://en.wikipedia.org/wiki/Online_algorithm[__streaming algorithm__]; it can output JSON a piece at a time, without the requirement that the entire output area is allocated at once:</string>
    <string name="">Value Conversion</string>
    <string name="">Given a user-defined type:</string>
    <string name="">We can define a conversion from the user-defined type to a &lt;&lt;ref_value&gt;&gt; by defining an overload of `tag_invoke` in the same namespace. This maps `customer` to a JSON object:</string>
    <string name="">This allows us to use the library function &lt;&lt;ref_value_from&gt;&gt; to produce a &lt;&lt;ref_value&gt;&gt; from our type:</string>
    <string name="">The library knows what to do with standard containers. Here we convert an array of customers to a value:</string>
    <string name="">To go from JSON to a user-defined type we use &lt;&lt;ref_value_to&gt;&gt;, which uses another overload of `tag_invoke`. This converts a JSON value to a `customer`. It throws an exception if the contents of the value do not match what is expected:</string>
    <string name="">The code above defines the convenience function `extract`, which deduces the types of the struct members. This works, but requires that the struct is {req_DefaultConstructible}. An alternative is to construct the object directly, which is a little more verbose but doesn\'t require default construction:</string>
    <string name="">Now we can construct customers from JSON:</string>
    <string name="">The library\'s generic algorithms recognize when you are converting a &lt;&lt;ref_value&gt;&gt; to a container which resembles an array or object, so if you wanted to turn a JSON array into a vector of customers you might write:</string>
</resources>
