@@ -1303,6 +1303,46 @@ class fields_base
13031303 core::string_view value,
13041304 system::error_code& ec);
13051305
1306+ // --------------------------------------------
1307+
1308+ /* * Format the container to the output stream
1309+
1310+ This function serializes the container to
1311+ the specified output stream.
1312+
1313+ @par Example
1314+ @code
1315+ request req;
1316+ req.set(field::content_length, "42");
1317+ std::stringstream ss;
1318+ ss << req;
1319+ assert( ss.str() == "GET / HTTP/1.1\nContent-Length: 42\n" );
1320+ @endcode
1321+
1322+ @par Effects
1323+ @code
1324+ return os << f.buffer();
1325+ @endcode
1326+
1327+ @par Complexity
1328+ Linear in `f.buffer().size()`
1329+
1330+ @par Exception Safety
1331+ Basic guarantee.
1332+
1333+ @return A reference to the output stream, for chaining
1334+
1335+ @param os The output stream to write to.
1336+
1337+ @param f The container to write.
1338+ */
1339+ friend
1340+ BOOST_HTTP_PROTO_DECL
1341+ std::ostream&
1342+ operator <<(
1343+ std::ostream& os,
1344+ const fields_base& f);
1345+
13061346private:
13071347 BOOST_HTTP_PROTO_DECL
13081348 void
@@ -1352,42 +1392,6 @@ class fields_base
13521392 std::size_t i) const noexcept ;
13531393};
13541394
1355- /* * Format the container to the output stream
1356-
1357- This function serializes the container to
1358- the specified output stream.
1359-
1360- @par Example
1361- @code
1362- request req;
1363- std::stringstream ss;
1364- ss << req;
1365- assert( ss.str() == "GET / HTTP/1.1\r\n\r\n" );
1366- @endcode
1367-
1368- @par Effects
1369- @code
1370- return os << f.buffer();
1371- @endcode
1372-
1373- @par Complexity
1374- Linear in `f.buffer().size()`
1375-
1376- @par Exception Safety
1377- Basic guarantee.
1378-
1379- @return A reference to the output stream, for chaining
1380-
1381- @param os The output stream to write to.
1382-
1383- @param f The container to write.
1384- */
1385- BOOST_HTTP_PROTO_DECL
1386- std::ostream&
1387- operator <<(
1388- std::ostream& os,
1389- const fields_base& f);
1390-
13911395} // http_proto
13921396} // boost
13931397
0 commit comments