30 std::ostream &
operator<<(std::ostream &s,
const std::complex<T> &c) {
31 s << c.real() << (c.imag() >= 0 ?
"+" :
"") << c.imag() <<
"j";
42 template <
typename T,
typename U>
43 std::ostream &
operator<<(std::ostream &s,
const std::pair<T, U> &p) {
55 std::ostream &
operator<<(std::ostream &s,
const std::vector<T> &c) {
57 typename std::vector<T>::const_iterator it = c.begin();
58 while (it != c.end()) {
76 template <
typename T, std::
size_t N>
77 typename std::enable_if<!std::is_same<T, char>::value, std::ostream &>::type
78 operator<<(std::ostream &s,
const std::array<T,N>& v) {
80 for (std::size_t i = 0; i < N; ++i) {
97 template <
typename T, std::
size_t N>
98 typename std::enable_if<!std::is_same<T, char>::value, std::ostream &>::type
101 for (std::size_t i = 0; i < N; ++i) {
114 template <
typename T,
typename... Ts>
115 inline std::ostream &
print_helper(std::ostream &out,
const T &t,
const Ts &... ts) {
116 using ttg::iostream::operator<<;
122 template <StdOstreamTag>
124 static std::mutex mutex;
130 template <
typename T,
typename... Ts>
131 void print(
const T &t,
const Ts &... ts) {
132 std::lock_guard<std::mutex> lock(detail::print_mutex_accessor<detail::StdOstreamTag::Cout>());
138 template <
typename T,
typename... Ts>
140 std::lock_guard<std::mutex> lock(detail::print_mutex_accessor<detail::StdOstreamTag::Cout>());
146 template <
typename T,
typename... Ts>
147 void log(
const T &t,
const Ts &... ts) {
148 std::lock_guard<std::mutex> lock(detail::print_mutex_accessor<detail::StdOstreamTag::Cout>());
std::ostream & print_helper(std::ostream &out)
std::mutex & print_mutex_accessor()
std::ostream & operator<<(std::ostream &s, const std::complex< T > &c)
default printing of std::complex
top-level TTG namespace contains runtime-neutral functionality
constexpr char print_seq_separator
void print(const T &t, const Ts &... ts)
atomically prints to std::cout a sequence of items (separated by ttg::print_separator) followed by st...
constexpr char print_separator
void log(const T &t, const Ts &... ts)
atomically prints to std::clog a sequence of items (separated by ttg::print_separator) followed by st...
void print_error(const T &t, const Ts &... ts)
atomically prints to std::cerr a sequence of items (separated by ttg::print_separator) followed by st...
constexpr char print_seq_end
constexpr char print_seq_begin