diff --git a/layout/generic/nsFrameList.h b/layout/generic/nsFrameList.h index 5a2fcce9d86f..7286cbd28c18 100644 --- a/layout/generic/nsFrameList.h +++ b/layout/generic/nsFrameList.h @@ -451,11 +451,6 @@ public: class Iterator { public: - typedef nsIFrame* ValueType; - // Though we don't support +/- a integer currently, - // iterators have to have a DifferenceType. - typedef ptrdiff_t DifferenceType; - Iterator(const nsFrameList& aList, nsIFrame* aCurrent) : mList(aList) , mCurrent(aCurrent) diff --git a/mfbt/EnumeratedRange.h b/mfbt/EnumeratedRange.h index a8c591032766..7f0c18b7ff86 100644 --- a/mfbt/EnumeratedRange.h +++ b/mfbt/EnumeratedRange.h @@ -31,9 +31,6 @@ template class EnumeratedIterator { public: - typedef EnumTypeT ValueType; - typedef typename MakeSigned::Type DifferenceType; - template explicit EnumeratedIterator(EnumType aCurrent) : mCurrent(aCurrent) { } @@ -69,25 +66,6 @@ public: return ret; } - EnumeratedIterator operator+(DifferenceType aN) const - { - return EnumeratedIterator(EnumTypeT(IntTypeT(mCurrent) + aN)); - } - EnumeratedIterator operator-(DifferenceType aN) const - { - return EnumeratedIterator(EnumTypeT(IntTypeT(mCurrent) - aN)); - } - EnumeratedIterator& operator+=(DifferenceType aN) - { - mCurrent = EnumTypeT(IntTypeT(mCurrent) + aN); - return *this; - } - EnumeratedIterator& operator-=(DifferenceType aN) - { - mCurrent = EnumTypeT(IntTypeT(mCurrent) - aN); - return *this; - } - /* Comparison operators */ template diff --git a/mfbt/IntegerRange.h b/mfbt/IntegerRange.h index ee3a2fa9da88..2ebfb3914533 100644 --- a/mfbt/IntegerRange.h +++ b/mfbt/IntegerRange.h @@ -21,9 +21,6 @@ template class IntegerIterator { public: - typedef IntTypeT ValueType; - typedef typename MakeSigned::Type DifferenceType; - template explicit IntegerIterator(IntType aCurrent) : mCurrent(aCurrent) { } @@ -41,25 +38,6 @@ public: IntegerIterator operator++(int) { auto ret = *this; ++mCurrent; return ret; } IntegerIterator operator--(int) { auto ret = *this; --mCurrent; return ret; } - IntegerIterator operator+(DifferenceType aN) const - { - return IntegerIterator(mCurrent + aN); - } - IntegerIterator operator-(DifferenceType aN) const - { - return IntegerIterator(mCurrent - aN); - } - IntegerIterator& operator+=(DifferenceType aN) - { - mCurrent += aN; - return *this; - } - IntegerIterator& operator-=(DifferenceType aN) - { - mCurrent -= aN; - return *this; - } - /* Comparison operators */ template diff --git a/mfbt/IteratorTraits.h b/mfbt/IteratorTraits.h deleted file mode 100644 index e7ee622dfa41..000000000000 --- a/mfbt/IteratorTraits.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* Iterator traits to expose a value type and a difference type */ - -#ifndef mozilla_IteratorTraits_h -#define mozilla_IteratorTraits_h - -#include - -namespace mozilla { - -template -struct IteratorTraits -{ - typedef typename Iterator::ValueType ValueType; - typedef typename Iterator::DifferenceType DifferenceType; -}; - -template -struct IteratorTraits -{ - typedef T ValueType; - typedef ptrdiff_t DifferenceType; -}; - -template -struct IteratorTraits -{ - typedef const T ValueType; - typedef ptrdiff_t DifferenceType; -}; - -} // namespace mozilla - -#endif // mozilla_IteratorTraits_h diff --git a/mfbt/ReverseIterator.h b/mfbt/ReverseIterator.h index 119b6ce72215..e1d247b65f82 100644 --- a/mfbt/ReverseIterator.h +++ b/mfbt/ReverseIterator.h @@ -12,7 +12,6 @@ #define mozilla_ReverseIterator_h #include "mozilla/Attributes.h" -#include "mozilla/IteratorTraits.h" #include "mozilla/TypeTraits.h" namespace mozilla { @@ -21,9 +20,6 @@ template class ReverseIterator { public: - typedef typename IteratorTraits::ValueType ValueType; - typedef typename IteratorTraits::DifferenceType DifferenceType; - template explicit ReverseIterator(Iterator aIter) : mCurrent(aIter) { } @@ -45,25 +41,6 @@ public: ReverseIterator operator++(int) { auto ret = *this; mCurrent--; return ret; } ReverseIterator operator--(int) { auto ret = *this; mCurrent++; return ret; } - ReverseIterator operator+(DifferenceType aN) const - { - return ReverseIterator(mCurrent - aN); - } - ReverseIterator operator-(DifferenceType aN) const - { - return ReverseIterator(mCurrent + aN); - } - ReverseIterator& operator+=(DifferenceType aN) - { - mCurrent -= aN; - return *this; - } - ReverseIterator& operator-=(DifferenceType aN) - { - mCurrent += aN; - return *this; - } - /* Comparison operators */ template diff --git a/mfbt/moz.build b/mfbt/moz.build index ab9a77c2f02f..a805cc9ebd45 100644 --- a/mfbt/moz.build +++ b/mfbt/moz.build @@ -46,7 +46,6 @@ EXPORTS.mozilla = [ 'IntegerPrintfMacros.h', 'IntegerRange.h', 'IntegerTypeTraits.h', - 'IteratorTraits.h', 'JSONWriter.h', 'Likely.h', 'LinkedList.h',