зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1175485 part 3 - Remove unused operators, typedefs and IteratorTraits. r=waldo
--HG-- extra : source : c1d3256e987c25935cc8bd321c413a1e0c7586b3
This commit is contained in:
Родитель
0a629d8242
Коммит
5ce6110994
|
@ -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)
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
|
@ -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>
|
||||
|
|
|
@ -46,7 +46,6 @@ EXPORTS.mozilla = [
|
|||
'IntegerPrintfMacros.h',
|
||||
'IntegerRange.h',
|
||||
'IntegerTypeTraits.h',
|
||||
'IteratorTraits.h',
|
||||
'JSONWriter.h',
|
||||
'Likely.h',
|
||||
'LinkedList.h',
|
||||
|
|
Загрузка…
Ссылка в новой задаче