tesseract v5.3.3.20231005
testing::internal::ContainerPrinter Struct Reference

#include <gtest-printers.h>

Static Public Member Functions

template<typename T , typename = typename std::enable_if< (sizeof(IsContainerTest<T>(0)) == sizeof(IsContainer)) && !IsRecursiveContainer<T>::value>::type>
static void PrintValue (const T &container, std::ostream *os)
 

Detailed Description

Definition at line 127 of file gtest-printers.h.

Member Function Documentation

◆ PrintValue()

template<typename T , typename = typename std::enable_if< (sizeof(IsContainerTest<T>(0)) == sizeof(IsContainer)) && !IsRecursiveContainer<T>::value>::type>
static void testing::internal::ContainerPrinter::PrintValue ( const T &  container,
std::ostream *  os 
)
inlinestatic

Definition at line 132 of file gtest-printers.h.

132 {
133 const size_t kMaxCount = 32; // The maximum number of elements to print.
134 *os << '{';
135 size_t count = 0;
136 for (auto&& elem : container) {
137 if (count > 0) {
138 *os << ',';
139 if (count == kMaxCount) { // Enough has been printed.
140 *os << " ...";
141 break;
142 }
143 }
144 *os << ' ';
145 // We cannot call PrintTo(elem, os) here as PrintTo() doesn't
146 // handle `elem` being a native array.
147 internal::UniversalPrint(elem, os);
148 ++count;
149 }
150
151 if (count > 0) {
152 *os << ' ';
153 }
154 *os << '}';
155 }
int * count
void UniversalPrint(const T &value, ::std::ostream *os)

The documentation for this struct was generated from the following file: