| Home | Libraries | People | FAQ | More

###### value::as_string (2 of 2 overloads)

Return a reference to the underlying `string`, or throw an exception.

<h7> Synopsis </h7>

    string const&
    as_string() const;

<h7> Description </h7>

If `is_string()` is `true`, returns a reference to the underlying `string`, otherwise throws an exception.

<h7> Complexity </h7>

Constant.

<h7> Exception Safety </h7>

Strong guarantee.

<h7> Exceptions </h7>

Type | Thrown On
--- | ---
`std::invalid_argument` | `! this->is_string()`