MyraMath
stream2string


Source: tests/utility/stream2string.cpp

1 // ========================================================================= //
2 // This file is part of MyraMath, copyright (c) 2014-2019 by Ryan A Chilton //
3 // and distributed by MyraCore, LLC. See LICENSE.txt for license terms. //
4 // ========================================================================= //
5 
12 #include <tests/myratest.h>
13 
14 using namespace myra_stlprint;
15 
16 ADD_TEST("stream2string","[utility]")
17  {
18  std::vector<int> v;
19  v.push_back(6);
20  v.push_back(2);
21  v.push_back(5);
22  myra::out() << v << std::endl;
23  myra::out() << stream2string(v) << std::endl;
24  }
25 
26 
Definition: stlprint.h:32
Routines for printing the contents of various std::container&#39;s to a std::ostream using operator <<...
std::string stream2string(const T &t)
Uses a std::stringstream to serialize a T into a std::string, note T must have a "std::ostream << t" ...
Definition: stlprint.h:158


Results: [PASS]

[ 6 2 5 ] (3)
[ 6 2 5 ] (3)


Go back to Summary of /test programs.