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

Method UniversalPrintArray

tests/gtest/gtest.h:8714–8733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8712// elements, starting at address 'begin'.
8713template <typename T>
8714void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
8715 if (len == 0) {
8716 *os << "{}";
8717 } else {
8718 *os << "{ ";
8719 const size_t kThreshold = 18;
8720 const size_t kChunkSize = 8;
8721 // If the array has more than kThreshold elements, we'll have to
8722 // omit some details by printing only the first and the last
8723 // kChunkSize elements.
8724 if (len <= kThreshold) {
8725 PrintRawArrayTo(begin, len, os);
8726 } else {
8727 PrintRawArrayTo(begin, kChunkSize, os);
8728 *os << ", ..., ";
8729 PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
8730 }
8731 *os << " }";
8732 }
8733}
8734// This overload prints a (const) char array compactly.
8735GTEST_API_ void UniversalPrintArray(
8736 const char* begin, size_t len, ::std::ostream* os);

Callers

nothing calls this directly

Calls 1

PrintRawArrayToFunction · 0.85

Tested by

no test coverage detected