| 9536 | // wants). |
| 9537 | template <typename T> |
| 9538 | void PrintTo(const T& value, ::std::ostream* os) { |
| 9539 | // DefaultPrintTo() is overloaded. The type of its first two |
| 9540 | // arguments determine which version will be picked. If T is an |
| 9541 | // STL-style container, the version for container will be called; if |
| 9542 | // T is a pointer, the pointer version will be called; otherwise the |
| 9543 | // generic version will be called. |
| 9544 | // |
| 9545 | // Note that we check for container types here, prior to we check |
| 9546 | // for protocol message types in our operator<<. The rationale is: |
| 9547 | // |
| 9548 | // For protocol messages, we want to give people a chance to |
| 9549 | // override Google Mock's format by defining a PrintTo() or |
| 9550 | // operator<<. For STL containers, other formats can be |
| 9551 | // incompatible with Google Mock's format for the container |
| 9552 | // elements; therefore we check for container types here to ensure |
| 9553 | // that our format is used. |
| 9554 | // |
| 9555 | // The second argument of DefaultPrintTo() is needed to bypass a bug |
| 9556 | // in Symbian's C++ compiler that prevents it from picking the right |
| 9557 | // overload between: |
| 9558 | // |
| 9559 | // PrintTo(const T& x, ...); |
| 9560 | // PrintTo(T* x, ...); |
| 9561 | DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os); |
| 9562 | } |
| 9563 | |
| 9564 | // The following list of PrintTo() overloads tells |
| 9565 | // UniversalPrinter<T>::Print() how to print standard types (built-in |
no test coverage detected