Bug 1526245 - Replaced std::iterator inheritance with iterator traits definitions in JSErrorNotes (as required by C++17). r=Waldo
authorTheQwertiest <qwertiest@mail.ru>
Mon, 11 Feb 2019 15:39:04 +0300
changeset 506567 b9a53cec8555d13272107a0e17ff52d3a093131e
parent 506566 144dfd01fb48d8ae338391e0263d867998d4de3b
child 506569 a3d28922f30e7f2b4b906a3951c18f8d512f4626
push id138
push usermtabara@mozilla.com
push dateWed, 20 Mar 2019 18:12:49 +0000
reviewersWaldo
bugs1526245
milestone68.0a1
Bug 1526245 - Replaced std::iterator inheritance with iterator traits definitions in JSErrorNotes (as required by C++17). r=Waldo
js/public/ErrorReport.h
--- a/js/public/ErrorReport.h
+++ b/js/public/ErrorReport.h
@@ -166,22 +166,27 @@ class JSErrorNotes {
                    JSErrorCallback errorCallback, void* userRef,
                    const unsigned errorNumber, ...);
 
   JS_PUBLIC_API size_t length();
 
   // Create a deep copy of notes.
   js::UniquePtr<JSErrorNotes> copy(JSContext* cx);
 
-  class iterator final
-      : public std::iterator<std::input_iterator_tag, js::UniquePtr<Note>> {
+  class iterator final {
    private:
     js::UniquePtr<Note>* note_;
 
    public:
+    using iterator_category = std::input_iterator_tag;
+    using value_type = js::UniquePtr<Note>;
+    using difference_type = ptrdiff_t;
+    using pointer = value_type*;
+    using reference = value_type&;
+
     explicit iterator(js::UniquePtr<Note>* note = nullptr) : note_(note) {}
 
     bool operator==(iterator other) const { return note_ == other.note_; }
     bool operator!=(iterator other) const { return !(*this == other); }
     iterator& operator++() {
       note_++;
       return *this;
     }