Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the develop branch, built from commit 0a00cc405f.
PrevUpHomeNext
value::if_array (2 of 2 overloads)

Return an array pointer if this is an array, else return nullptr

Synopsis
array*
if_array() noexcept;
Description

If this->kind() == kind::array, returns a pointer to the underlying array. Otherwise, returns nullptr.

Example

The return value is used in both a boolean context and to assign a variable:

if( auto p = jv.if_array() )
    return *p;
Complexity

Constant.

Exception Safety

No-throw guarantee.


PrevUpHomeNext