2019-12-14 07:56:15 -05:00
|
|
|
/*
|
|
|
|
Copyright 2019 Glen Joseph Fernandes
|
|
|
|
(glenjofe@gmail.com)
|
|
|
|
|
|
|
|
Distributed under the Boost Software License, Version 1.0.
|
|
|
|
(http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
*/
|
|
|
|
#include <boost/io/ostream_joiner.hpp>
|
2019-12-23 21:25:17 -05:00
|
|
|
#include <boost/core/lightweight_test.hpp>
|
2019-12-14 07:56:15 -05:00
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
std::ostringstream o;
|
|
|
|
boost::io::ostream_joiner<char> j = boost::io::make_ostream_joiner(o, ',');
|
|
|
|
*j++ = 1;
|
|
|
|
*j++ = '2';
|
|
|
|
*j++ = "3";
|
|
|
|
BOOST_TEST_EQ(o.str(), "1,2,3");
|
|
|
|
return boost::report_errors();
|
|
|
|
}
|