| Home | Libraries | People | FAQ | More

## Function template io

boost::pfr::io

## Synopsis

    // In header: <boost/pfr/io.hpp>

    template<typename T> BOOST_PFR_BEGIN_MODULE_EXPORT auto io(T && value);

## Description

IO manipulator to read/write simple aggregate `value` using its IO stream operators or using boost::pfr::io_fields if operators are not available.

Example:

    struct my_struct { int i; short s; };
    my_struct x;
    std::stringstream ss;
    ss << "{ 12, 13 }";
    ss >> boost::pfr::io(x);
    assert(x.i == 12);
    assert(x.s == 13);

See Also : 'Custom printing of aggregates' for info on how to implement your own manipulator with custom format.