diff --git a/layout/generic/nsFrameList.h b/layout/generic/nsFrameList.h index 5a2fcce9d86fc3328ff30b28d565fdd118b9ff20..7286cbd28c180ff00ed90e46ca1ef226b244044c 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 a8c591032766b9ad92cd194dd80d4641f7b44d1a..7f0c18b7ff869199b33b052772b54502c42ac1dd 100644 --- a/mfbt/EnumeratedRange.h +++ b/mfbt/EnumeratedRange.h @@ -31,9 +31,6 @@ template<typename IntTypeT, typename EnumTypeT> class EnumeratedIterator { public: - typedef EnumTypeT ValueType; - typedef typename MakeSigned<IntTypeT>::Type DifferenceType; - template<typename EnumType> 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<typename IntType, typename EnumType> diff --git a/mfbt/IntegerRange.h b/mfbt/IntegerRange.h index ee3a2fa9da8845e2ad99430818598d7467ca326e..2ebfb3914533d39a2609649e3b8566dede57be1a 100644 --- a/mfbt/IntegerRange.h +++ b/mfbt/IntegerRange.h @@ -21,9 +21,6 @@ template<typename IntTypeT> class IntegerIterator { public: - typedef IntTypeT ValueType; - typedef typename MakeSigned<IntTypeT>::Type DifferenceType; - template<typename IntType> 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<typename IntType1, typename IntType2> diff --git a/mfbt/IteratorTraits.h b/mfbt/IteratorTraits.h deleted file mode 100644 index e7ee622dfa41adb51b3765e8bdd6665b73b1c3f3..0000000000000000000000000000000000000000 --- 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 <stddef.h> - -namespace mozilla { - -template<typename Iterator> -struct IteratorTraits -{ - typedef typename Iterator::ValueType ValueType; - typedef typename Iterator::DifferenceType DifferenceType; -}; - -template<typename T> -struct IteratorTraits<T*> -{ - typedef T ValueType; - typedef ptrdiff_t DifferenceType; -}; - -template<typename T> -struct IteratorTraits<const T*> -{ - 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 119b6ce7221591b5ae26dc12f24e77b5eb869bc4..e1d247b65f8201c39c4e2f920a8be3bd33cceab4 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<typename IteratorT> class ReverseIterator { public: - typedef typename IteratorTraits<IteratorT>::ValueType ValueType; - typedef typename IteratorTraits<IteratorT>::DifferenceType DifferenceType; - template<typename Iterator> 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<typename Iterator1, typename Iterator2> diff --git a/mfbt/moz.build b/mfbt/moz.build index ab9a77c2f02fb0771d051f532e4f36631df5c4b4..a805cc9ebd45c88e27a02ea2d47c9d8731cba017 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',