Merge "Base: Delete ostream<< with std::string*"

This commit is contained in:
Treehugger Robot 2017-09-20 21:58:39 +00:00 committed by Gerrit Code Review
commit 2dd3b6e349
1 changed files with 10 additions and 0 deletions

View File

@ -438,4 +438,14 @@ class ScopedLogSeverity {
} // namespace base
} // namespace android
namespace std {
// Delete << with string* to avoid mistakes. The intention was most likely to print *string.
// If you really want to print the pointer, consider static_cast<void*>.
//
// Note: for this to work, we need to have this in a namespace.
std::ostream& operator<<(std::ostream& stream, const std::string* string_pointer) = delete;
} // namespace std
#endif // ANDROID_BASE_LOGGING_H