Replace base/template_util.h stuff with C++11 type_traits

BUG=chromium:554293

Change-Id: I5fe06bcba261dd770f1882519b541f870f4a1e62
Reviewed-on: https://chromium-review.googlesource.com/331150
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Taiju Tsuiki 2016-03-08 17:35:47 +09:00 committed by Mark Mentovai
parent 71f6724239
commit 12536e06e5
2 changed files with 8 additions and 3 deletions

View File

@ -30,6 +30,11 @@ struct remove_reference { using type = T; };
template <class T>
struct remove_reference<T&> { using type = T; };
template <typename T, typename S>
struct is_same { enum { value = false }; };
template <typename T>
struct is_same<T, T> { enum { value = true }; };
} // namespace std
#endif // CXX_LIBRARY_VERSION

View File

@ -18,11 +18,11 @@
#include <algorithm>
#include <limits>
#include <type_traits>
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/stringprintf.h"
#include "base/template_util.h"
#include "build/build_config.h"
#include "util/numeric/safe_assignment.h"
#include "util/win/get_function.h"
@ -636,9 +636,9 @@ std::vector<CheckedRange<WinVMAddress, WinVMSize>> GetReadableRangesOfMemoryMap(
// Find all the ranges that overlap the target range, maintaining their order.
ProcessInfo::MemoryBasicInformation64Vector overlapping;
for (const auto& mi : memory_info) {
static_assert(base::is_same<decltype(mi.BaseAddress), WinVMAddress>::value,
static_assert(std::is_same<decltype(mi.BaseAddress), WinVMAddress>::value,
"expected range address to be WinVMAddress");
static_assert(base::is_same<decltype(mi.RegionSize), WinVMSize>::value,
static_assert(std::is_same<decltype(mi.RegionSize), WinVMSize>::value,
"expected range size to be WinVMSize");
if (range.OverlapsRange(Range(mi.BaseAddress, mi.RegionSize)))
overlapping.push_back(mi);