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 an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
value_to (2 of 2 overloads)

Convert a value to an object of type T.

Synopsis

Defined in header <boost/json/value_to.hpp>

template<
    class T,
    class U>
T
value_to(
    U const& jv);
Description

This overload is deleted and participates in overload resolution only when U is not value. The overload exists to prevent unintented creation of temporary value instances, e.g.

auto flag = value_to<bool>(true);

Convenience header <boost/json.hpp>


PrevUpHomeNext