value::if_int64

## `value::if_int64`

Return a pointer to the underlying `std::int64_t`.

### Synopsis

    std::int64_t const*
    if_int64() const noexcept; (1)

    std::int64_t*
    if_int64() noexcept; (2)

### Description

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

### Example

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

    if( auto p = jv.if_int64() )
        return *p;

### Complexity

Constant.

### Exception Safety

No-throw guarantee.

Edit this page