Commit f609f04a authored by Loo Rong Jie's avatar Loo Rong Jie Committed by Commit Bot

std::iterator is deprecated in C++17

Bug: v8:6494
Change-Id: Ie6f91c3bad38e467dd047f4d2848473cc4085c2a
Reviewed-on: https://chromium-review.googlesource.com/536397
Commit-Queue: Loo Rong Jie <loorongjie@gmail.com>
Reviewed-by: 's avatarJochen Eisinger <jochen@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46004}
parent ee188afe
......@@ -10,6 +10,16 @@
namespace v8 {
namespace base {
template <class Category, class Type, class Diff = std::ptrdiff_t,
class Pointer = Type*, class Reference = Type&>
struct iterator {
typedef Category iterator_category;
typedef Type value_type;
typedef Diff difference_type;
typedef Pointer pointer;
typedef Reference reference;
};
// The intention of the base::iterator_range class is to encapsulate two
// iterators so that the range defined by the iterators can be used like
// a regular STL container (actually only a subset of the full container
......
......@@ -14,6 +14,7 @@
#include "src/base/atomicops.h"
#include "src/base/bits.h"
#include "src/base/hashmap.h"
#include "src/base/iterator.h"
#include "src/base/platform/mutex.h"
#include "src/flags.h"
#include "src/globals.h"
......@@ -1481,7 +1482,7 @@ class V8_EXPORT_PRIVATE ObjectIterator : public Malloced {
template <class PAGE_TYPE>
class PageIteratorImpl
: public std::iterator<std::forward_iterator_tag, PAGE_TYPE> {
: public base::iterator<std::forward_iterator_tag, PAGE_TYPE> {
public:
explicit PageIteratorImpl(PAGE_TYPE* p) : p_(p) {}
PageIteratorImpl(const PageIteratorImpl<PAGE_TYPE>& other) : p_(other.p_) {}
......
......@@ -5,8 +5,6 @@
#ifndef V8_WASM_FUNCTION_BODY_DECODER_H_
#define V8_WASM_FUNCTION_BODY_DECODER_H_
#include <iterator>
#include "src/base/compiler-specific.h"
#include "src/base/iterator.h"
#include "src/globals.h"
......@@ -129,7 +127,7 @@ class V8_EXPORT_PRIVATE BytecodeIterator : public NON_EXPORTED_BASE(Decoder) {
// If one wants to iterate over the bytecode without looking at {pc_offset()}.
class opcode_iterator
: public iterator_base,
public std::iterator<std::input_iterator_tag, WasmOpcode> {
public base::iterator<std::input_iterator_tag, WasmOpcode> {
public:
inline WasmOpcode operator*() {
DCHECK_LT(ptr_, end_);
......@@ -145,7 +143,7 @@ class V8_EXPORT_PRIVATE BytecodeIterator : public NON_EXPORTED_BASE(Decoder) {
// opcodes.
class offset_iterator
: public iterator_base,
public std::iterator<std::input_iterator_tag, uint32_t> {
public base::iterator<std::input_iterator_tag, uint32_t> {
public:
inline uint32_t operator*() {
DCHECK_LT(ptr_, end_);
......
......@@ -74,7 +74,7 @@ namespace {
// An iterator that returns first the module itself, then all modules linked via
// next, then all linked via prev.
class CompiledModulesIterator
: public std::iterator<std::input_iterator_tag,
: public v8::base::iterator<std::input_iterator_tag,
Handle<WasmCompiledModule>> {
public:
CompiledModulesIterator(Isolate* isolate,
......@@ -132,7 +132,7 @@ class CompiledModulesIterator
// An iterator based on the CompiledModulesIterator, but it returns all live
// instances, not the WasmCompiledModules itself.
class CompiledModuleInstancesIterator
: public std::iterator<std::input_iterator_tag,
: public v8::base::iterator<std::input_iterator_tag,
Handle<WasmInstanceObject>> {
public:
CompiledModuleInstancesIterator(Isolate* isolate,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment