MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / DefaultPrintTo

Function DefaultPrintTo

tests/gtest/gtest.h:8390–8414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8388// a PrintTo() for it.
8389template <typename C>
8390void DefaultPrintTo(WrapPrinterType<kPrintContainer> /* dummy */,
8391 const C& container, ::std::ostream* os) {
8392 const size_t kMaxCount = 32; // The maximum number of elements to print.
8393 *os << '{';
8394 size_t count = 0;
8395 for (typename C::const_iterator it = container.begin();
8396 it != container.end(); ++it, ++count) {
8397 if (count > 0) {
8398 *os << ',';
8399 if (count == kMaxCount) { // Enough has been printed.
8400 *os << " ...";
8401 break;
8402 }
8403 }
8404 *os << ' ';
8405 // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
8406 // handle *it being a native array.
8407 internal::UniversalPrint(*it, os);
8408 }
8409
8410 if (count > 0) {
8411 *os << ' ';
8412 }
8413 *os << '}';
8414}
8415
8416// Used to print a pointer that is neither a char pointer nor a member
8417// pointer, when the user doesn't define PrintTo() for it. (A member

Callers 1

PrintToFunction · 0.85

Calls 3

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected