| Home | Libraries | People | FAQ | More

###### value::value (35 of 35 overloads)

Construct from an initializer-list.

###### Synopsis

    value(
        std::initializer_list< value_ref > init,
        storage_ptr sp = {});

###### Description

If the initializer list consists of key/value pairs, an `object` is created. Otherwise an `array` is created. The contents of the initializer list are copied to the newly constructed value using the specified memory resource.

###### Complexity

Linear in `init.size()`.

###### Exception Safety

Strong guarantee. Calls to `memory_resource::allocate` may throw.

###### Parameters

Name | Description
--- | ---
`init` | The initializer list to construct from.
`sp` | A pointer to the `memory_resource` to use. The container will acquire shared ownership of the memory resource.