src/corelib/tools/qset.h
changeset 18 2f34d5167611
parent 0 1918ee327afb
child 30 5dc02b23752f
equal deleted inserted replaced
3:41300fa6a67c 18:2f34d5167611
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtCore module of the Qt Toolkit.
     7 ** This file is part of the QtCore module of the Qt Toolkit.
     8 **
     8 **
    95         typename Hash::iterator i;
    95         typename Hash::iterator i;
    96         friend class const_iterator;
    96         friend class const_iterator;
    97 
    97 
    98     public:
    98     public:
    99         typedef std::bidirectional_iterator_tag iterator_category;
    99         typedef std::bidirectional_iterator_tag iterator_category;
   100         typedef ptrdiff_t difference_type;
   100         typedef qptrdiff difference_type;
   101         typedef T value_type;
   101         typedef T value_type;
   102         typedef const T *pointer;
   102         typedef const T *pointer;
   103         typedef const T &reference;
   103         typedef const T &reference;
   104 
   104 
   105         inline iterator() {}
   105         inline iterator() {}
   130         typename Hash::const_iterator i;
   130         typename Hash::const_iterator i;
   131         friend class iterator;
   131         friend class iterator;
   132 
   132 
   133     public:
   133     public:
   134         typedef std::bidirectional_iterator_tag iterator_category;
   134         typedef std::bidirectional_iterator_tag iterator_category;
   135         typedef ptrdiff_t difference_type;
   135         typedef qptrdiff difference_type;
   136         typedef T value_type;
   136         typedef T value_type;
   137         typedef const T *pointer;
   137         typedef const T *pointer;
   138         typedef const T &reference;
   138         typedef const T &reference;
   139 
   139 
   140         inline const_iterator() {}
   140         inline const_iterator() {}
   186     typedef T value_type;
   186     typedef T value_type;
   187     typedef value_type *pointer;
   187     typedef value_type *pointer;
   188     typedef const value_type *const_pointer;
   188     typedef const value_type *const_pointer;
   189     typedef value_type &reference;
   189     typedef value_type &reference;
   190     typedef const value_type &const_reference;
   190     typedef const value_type &const_reference;
   191     typedef ptrdiff_t difference_type;
   191     typedef qptrdiff difference_type;
   192     typedef int size_type;
   192     typedef int size_type;
   193 
   193 
   194     inline bool empty() const { return isEmpty(); }
   194     inline bool empty() const { return isEmpty(); }
   195 
       
   196     // comfort
   195     // comfort
   197     inline QSet<T> &operator<<(const T &value) { insert(value); return *this; }
   196     inline QSet<T> &operator<<(const T &value) { insert(value); return *this; }
   198     inline QSet<T> &operator|=(const QSet<T> &other) { unite(other); return *this; }
   197     inline QSet<T> &operator|=(const QSet<T> &other) { unite(other); return *this; }
   199     inline QSet<T> &operator|=(const T &value) { insert(value); return *this; }
   198     inline QSet<T> &operator|=(const T &value) { insert(value); return *this; }
   200     inline QSet<T> &operator&=(const QSet<T> &other) { intersect(other); return *this; }
   199     inline QSet<T> &operator&=(const QSet<T> &other) { intersect(other); return *this; }