16 RedirectCout() : ssBuffer_(), coutBuffer_(std::cout.rdbuf(ssBuffer_.rdbuf())) {}
19 std::string
str()
const;
25 std::stringstream ssBuffer_;
26 std::streambuf* coutBuffer_;
34#include <boost/version.hpp>
35#if BOOST_VERSION >= 106600
36#include <boost/mp11/integer_sequence.hpp>
41template <
size_t... Ints>
42struct index_sequence {
43 using type = index_sequence;
44 using value_type = size_t;
45 static constexpr std::size_t size() noexcept {
return sizeof...(Ints); }
48template <
class Sequence1,
class Sequence2>
51template <
size_t... I1,
size_t... I2>
53 : index_sequence<I1..., (sizeof...(I1) + I2)...> {};
56struct make_index_sequence
58 typename make_index_sequence<N / 2>::type,
59 typename make_index_sequence<N - N / 2>::type> {};
61struct make_index_sequence<0> : index_sequence<> {};
63struct make_index_sequence<1> : index_sequence<0> {};
65using index_sequence_for = make_index_sequence<
sizeof...(T)>;
Global functions in a separate testing namespace.
Definition chartTesting.h:28
For Python str().
Definition utilities.h:14
~RedirectCout()
destructor – redirect stdout buffer to its original buffer
Definition utilities.cpp:9
std::string str() const
return the string
Definition utilities.cpp:5
RedirectCout()
constructor – redirect stdout buffer to a stringstream buffer
Definition utilities.h:16
Definition utilities.h:49