diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-08-01 12:59:39 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-08-04 12:40:43 +0000 |
commit | 28b1110370900897ab652cb420c371fab8857ad4 (patch) | |
tree | 41b32127d23b0df4f2add2a27e12dc87bddb260e /chromium/base/logging.h | |
parent | 399c965b6064c440ddcf4015f5f8e9d131c7a0a6 (diff) |
BASELINE: Update Chromium to 53.0.2785.41
Also adds a few extra files for extensions.
Change-Id: Iccdd55d98660903331cf8b7b29188da781830af4
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/base/logging.h')
-rw-r--r-- | chromium/base/logging.h | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/chromium/base/logging.h b/chromium/base/logging.h index 36c9c6f311d..fd148aa2694 100644 --- a/chromium/base/logging.h +++ b/chromium/base/logging.h @@ -11,10 +11,13 @@ #include <cstring> #include <sstream> #include <string> +#include <type_traits> +#include <utility> #include "base/base_export.h" #include "base/debug/debugger.h" #include "base/macros.h" +#include "base/template_util.h" #include "build/build_config.h" // @@ -516,14 +519,26 @@ class CheckOpResult { // This formats a value for a failing CHECK_XX statement. Ordinarily, // it uses the definition for operator<<, with a few special cases below. template <typename T> -inline void MakeCheckOpValueString(std::ostream* os, const T& v) { +inline typename std::enable_if< + base::internal::SupportsOstreamOperator<const T&>::value, + void>::type +MakeCheckOpValueString(std::ostream* os, const T& v) { (*os) << v; } -// We need an explicit specialization for std::nullptr_t. -template <> -BASE_EXPORT void MakeCheckOpValueString(std::ostream* os, - const std::nullptr_t& p); +// We need overloads for enums that don't support operator<<. +// (i.e. scoped enums where no operator<< overload was declared). +template <typename T> +inline typename std::enable_if< + !base::internal::SupportsOstreamOperator<const T&>::value && + std::is_enum<T>::value, + void>::type +MakeCheckOpValueString(std::ostream* os, const T& v) { + (*os) << static_cast<typename base::underlying_type<T>::type>(v); +} + +// We need an explicit overload for std::nullptr_t. +BASE_EXPORT void MakeCheckOpValueString(std::ostream* os, std::nullptr_t p); // Build the error message string. This is separate from the "Impl" // function template because it is not performance critical and so can |