| 8388 | // a PrintTo() for it. |
| 8389 | template <typename C> |
| 8390 | void 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 |
no test coverage detected