Make tst_qalgorithms compliant with the Standard

§24.4.1 [iterator.traits] of N3337 makes it *mandatory* to define the
various types

    std::iterator_traits<Iterator>::{value,pointer,...}

for any given iterator.

§24.4.1.2 makes it enough to define them within our iterator class.

Change-Id: I1305c8392d224889b09395e30ecc77b194020a15
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Giuseppe D'Angelo 2013-09-04 20:46:15 +02:00 committed by The Qt Project
parent c0df6cbe86
commit 9fc2c729b4

View File

@ -44,6 +44,7 @@
#include <iostream>
#include <iomanip>
#include <sstream>
#include <iterator>
#include <algorithm>
#include <qalgorithms.h>
#include <QStringList>
@ -846,6 +847,12 @@ void tst_QAlgorithms::qCountContainer() const
class RAI
{
public:
typedef int difference_type;
typedef int value_type;
typedef std::random_access_iterator_tag iterator_category;
typedef int *pointer;
typedef int &reference;
RAI(int searched = 5, int hidePos = 4, int len = 10)
: curPos_(0)
, length_(len)