7#include <QtCore/qhash.h>
8#include <QtCore/qcontainertools_impl.h>
10#include <initializer_list>
25 template <
typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true>
26 inline QSet(InputIterator
first, InputIterator last)
39 template <
typename U = T>
41 {
return q_hash ==
other.q_hash; }
42 template <
typename U = T>
44 {
return q_hash !=
other.q_hash; }
65 template <
typename Pred>
112 friend class QSet<T>;
207template <
typename InputIterator,
208 typename ValueType =
typename std::iterator_traits<InputIterator>::value_type,
227 if (!q_hash.isSharedWith(
other.q_hash)) {
247 for (
const auto &
e : std::as_const(copy1)) {
257 const bool otherIsBigger =
other.size() >
size();
259 const QSet &biggestSet = otherIsBigger ?
other : *
this;
275 if (q_hash.isSharedWith(
other.q_hash)) {
278 for (
const auto &
e :
other)
288 while (
i !=
other.constEnd()) {
311#if !defined(QT_NO_JAVA_STYLE_ITERATORS)
318 inline bool item_exists()
const {
return c->constEnd() !=
n; }
323 {
i =
c->begin();
n =
c->end(); }
325 {
c = &container;
i =
c->begin();
n =
c->end();
return *
this; }
328 inline bool hasNext()
const {
return c->constEnd() !=
i; }
329 inline const T &
next() {
n =
i++;
return *
n; }
332 {
if (
c->constEnd() !=
n) {
i =
c->erase(
n);
n =
c->end(); } }
335 {
while (
c->constEnd() != (
n =
i))
if (*
i++ ==
t)
return true;
return false; }
339template <
typename T,
typename Predicate>
void squeeze()
Reduces the size of the QHash's internal hash table to save memory.
bool remove(const Key &key)
Removes the item that has the key from the hash.
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
qsizetype size() const noexcept
Returns the number of items in the hash.
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
iterator emplace(const Key &key, Args &&... args)
const_iterator constBegin() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
bool isDetached() const noexcept
iterator erase(const_iterator it)
bool contains(const Key &key) const noexcept
Returns true if the hash contains an item with the key; otherwise returns false.
void swap(QHash &other) noexcept
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
friend class const_iterator
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
qsizetype capacity() const noexcept
Returns the number of buckets in the QHash's internal hash table.
bool isEmpty() const noexcept
Returns true if the hash contains no items; otherwise returns false.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
QMutableSetIterator & operator=(QSet< T > &container)
QMutableSetIterator(QSet< T > &container)
bool findNext(const T &t)
const T & peekNext() const
std::forward_iterator_tag iterator_category
const_iterator(const const_iterator &o)
const T * operator->() const
const_iterator & operator++()
const_iterator(typename Hash::const_iterator o)
bool operator!=(const const_iterator &o) const
const T & operator*() const
const_iterator & operator=(const const_iterator &o)
bool operator==(const const_iterator &o) const
const_iterator operator++(int)
const_iterator(const iterator &o)
iterator(const iterator &o)
std::forward_iterator_tag iterator_category
iterator & operator=(const iterator &o)
const T * operator->() const
bool operator!=(const iterator &o) const
const T & operator*() const
bool operator!=(const const_iterator &o) const
iterator(typename Hash::iterator o)
bool operator==(const const_iterator &o) const
bool operator==(const iterator &o) const
QTypeTraits::compare_eq_result_container< QSet, U > operator!=(const QSet< T > &other) const
QSet< T > & operator-=(const T &value)
QSet< T > & operator|=(const T &value)
const_iterator end() const noexcept
QList< T > values() const
const value_type * const_pointer
QSet< T > & intersect(const QSet< T > &other)
const_iterator ConstIterator
bool remove(const T &value)
void swap(QSet< T > &other) noexcept
bool contains(const QSet< T > &set) const
const value_type & const_reference
QSet< T > & operator-=(const QSet< T > &other)
QSet< T > & operator+=(const QSet< T > &other)
QSet< T > operator+(const QSet< T > &other) const
const_iterator constBegin() const noexcept
QSet< T > operator&(const QSet< T > &other) const
const_iterator cend() const noexcept
const_iterator constEnd() const noexcept
QTypeTraits::compare_eq_result_container< QSet, U > operator==(const QSet< T > &other) const
QSet< T > & operator|=(const QSet< T > &other)
iterator erase(const_iterator i)
QSet(InputIterator first, InputIterator last)
iterator insert(T &&value)
QSet< T > & operator+=(const T &value)
const_iterator constFind(const T &value) const
QSet< T > & operator<<(const T &value)
QSet< T > & operator&=(const T &value)
iterator insert(const_iterator, const T &value)
iterator find(const T &value)
QSet< T > & unite(const QSet< T > &other)
QSet< T > & operator&=(const QSet< T > &other)
void reserve(qsizetype size)
QSet< T > operator|(const QSet< T > &other) const
const_iterator begin() const noexcept
bool intersects(const QSet< T > &other) const
const_iterator find(const T &value) const
bool contains(const T &value) const
qsizetype capacity() const
const_iterator cbegin() const noexcept
iterator insert(const T &value)
qsizetype removeIf(Pred predicate)
QSet(std::initializer_list< T > list)
QSet< T > operator-(const QSet< T > &other) const
QSet< T > & subtract(const QSet< T > &other)
cache insert(employee->id(), employee)
Combined button and popup list for selecting options.
std::enable_if_t< std::conjunction_v< QTypeTraits::has_operator_equal_container< Container, T >... >, bool > compare_eq_result_container
qsizetype qset_erase_if(QSet< T > &set, Predicate &pred)
typename std::enable_if< std::is_convertible< typename std::iterator_traits< Iterator >::iterator_category, std::input_iterator_tag >::value, bool >::type IfIsInputIterator
void reserveIfForwardIterator(Container *, InputIterator, InputIterator)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
size_t qHashRangeCommutative(InputIterator first, InputIterator last, size_t seed=0) noexcept(noexcept(qHash(*first)))
#define Q_DECLARE_SEQUENTIAL_ITERATOR(C)
static bool contains(const QJsonArray &haystack, unsigned needle)
GLenum GLuint GLintptr GLsizeiptr size
[1]
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
size_t qHash(const QSet< T > &key, size_t seed=0) noexcept(noexcept(qHashRangeCommutative(key.begin(), key.end(), seed)))
qsizetype erase_if(QSet< T > &set, Predicate pred)
QFuture< QSet< QChar > > set
[10]
settings remove("monkey")