Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения
std:: расстояниеначало[,]конец[]
  • size_typemax_sizeconst;
  • Class template unordered_map

    Boost , The Boost C++ Libraries BoostBook Documentation Subset , Reference

    Boost C++ Libraries

    ...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

    PrevUpHomeNext

    Class template unordered_map

    boost::unordered_map — An unordered associative container that associates unique keys with another value.

    Synopsis

    // In header: <boost/unordered_map.hpp>
    template<typename Key, typename Mapped, typename Hash = boost::hash<Key>, 
             typename Pred = std::equal_to<Key>, 
             typename Alloc = std::allocator<std::pair<Key const, Mapped>> > 
    class unordered_map {
    public:
      // types
      typedef Key                                    key_type;            
      typedef std::pair<Key const, Mapped>           value_type;          
      typedef Mapped                                 mapped_type;         
      typedef Hash                                   hasher;              
      typedef Pred                                   key_equal;           
      typedef Alloc                                  allocator_type;      
      typedef typename allocator_type::pointer       pointer;             
      typedef typename allocator_type::const_pointer const_pointer;       
      typedef value_type&                            reference;             // lvalue of value_type.
      typedef value_type const&                      const_reference;       // const lvalue of value_type.
      typedef implementation-defined                 size_type;           
      typedef implementation-defined                 difference_type;     
      typedef implementation-defined                 iterator;            
      typedef implementation-defined                 const_iterator;      
      typedef implementation-defined                 local_iterator;      
      typedef implementation-defined                 const_local_iterator;
      // construct/copy/destruct
      explicit unordered_map(size_type = implementation-defined, 
                             hasher const& = hasher(), 
                             key_equal const& = key_equal(), 
                             allocator_type const& = allocator_type());
      template<typename InputIterator> 
        unordered_map(InputIterator, InputIterator, 
                      size_type = implementation-defined, 
                      hasher const& = hasher(), key_equal const& = key_equal(), 
                      allocator_type const& = allocator_type());
      unordered_map(unordered_map const&);
      unordered_map(unordered_map &&);
      explicit unordered_map(Allocator const&);
      unordered_map(unordered_map const&, Allocator const&);
      ~unordered_map();
      unordered_map& operator=(unordered_map const&);
      unordered_map& operator=(unordered_map &&);
      allocator_type get_allocator() const;
      // size and capacity
      bool empty() const;
      size_type size() const;
      size_type max_size() const;
      // iterators
      iterator begin();
      const_iterator begin() const;
      iterator end();
      const_iterator end() const;
      const_iterator cbegin() const;
      const_iterator cend() const;
      // modifiers
      template<typename... Args> std::pair<iterator, bool> emplace(Args&&...);
      template<typename... Args> iterator emplace_hint(const_iterator, Args&&...);
      std::pair<iterator, bool> insert(value_type const&);
      std::pair<iterator, bool> insert(value_type&&);
      iterator insert(const_iterator, value_type const&);
      iterator insert(const_iterator, value_type&&);
      template<typename InputIterator> void insert(InputIterator, InputIterator);
      iterator erase(const_iterator);
      size_type erase(key_type const&);
      iterator erase(const_iterator, const_iterator);
      void quick_erase(const_iterator);
      void erase_return_void(const_iterator);
      void clear();
      void swap(unordered_map&);
      // observers
      hasher hash_function() const;
      key_equal key_eq() const;
      // lookup
      iterator find(key_type const&);
      const_iterator find(key_type const&) const;
      template<typename CompatibleKey, typename CompatibleHash, 
               typename CompatiblePredicate> 
        iterator find(CompatibleKey const&, CompatibleHash const&, 
                      CompatiblePredicate const&);
      template<typename CompatibleKey, typename CompatibleHash, 
               typename CompatiblePredicate> 
        const_iterator 
        find(CompatibleKey const&, CompatibleHash const&, 
             CompatiblePredicate const&) const;
      size_type count(key_type const&) const;
      std::pair<iterator, iterator> equal_range(key_type const&);
      std::pair<const_iterator, const_iterator> equal_range(key_type const&) const;
      mapped_type& operator[](key_type const&);
      Mapped& at(key_type const&);
      Mapped const& at(key_type const&) const;
      // bucket interface
      size_type bucket_count() const;
      size_type max_bucket_count() const;
      size_type bucket_size(size_type) const;
      size_type bucket(key_type const&) const;
      local_iterator begin(size_type);
      const_local_iterator begin(size_type) const;
      local_iterator end(size_type);
      const_local_iterator end(size_type) const;
      const_local_iterator cbegin(size_type) const;
      const_local_iterator cend(size_type);
      // hash policy
      float load_factor() const;
      float max_load_factor() const;
      void max_load_factor(float);
      void rehash(size_type);
      void reserve(size_type);
    };
    // Equality Comparisons
    template<typename Key, typename Mapped, typename Hash, typename Pred, 
             typename Alloc> 
      bool operator==(unordered_map<Key, Mapped, Hash, Pred, Alloc> const&, 
                      unordered_map<Key, Mapped, Hash, Pred, Alloc> const&);
    template<typename Key, typename Mapped, typename Hash, typename Pred, 
             typename Alloc> 
      bool operator!=(unordered_map<Key, Mapped, Hash, Pred, Alloc> const&, 
                      unordered_map<Key, Mapped, Hash, Pred, Alloc> const&);
    // swap
    template<typename Key, typename Mapped, typename Hash, typename Pred, 
             typename Alloc> 
      void swap(unordered_map<Key, Mapped, Hash, Pred, Alloc>&, 
                unordered_map<Key, Mapped, Hash, Pred, Alloc>&);

    Description

    Параметры шаблонов

    Ключ Ключдолжен бытьСтираемыйиз контейнера (т.е.черт распределителяможетуничтожитьего).
    Карта Карточкадолжна бытьСтираемойиз контейнера (т.е.черт распределителяможетуничтожитьего).
    Хаш Тип объекта унарной функции, который выполняет хеш-функцию для ключа. Он принимает один аргумент типаКлючи возвращает значение типа std::size_t.
    Пред Объект двоичной функции, реализующий отношение эквивалентности по значениям типаКлюч. Объект двоичной функции, индуцирующий отношение эквивалентности по значениям типаКлюч. Он принимает два аргумента типаKeyи возвращает значение типа bool.
    Аллок Распределитель, тип значения которого совпадает с типом значения контейнера.

    Элементы организованы в ведра. Ключи с одинаковым хеш-кодом хранятся в одном ведре.

    Количество ведер может быть автоматически увеличено путем вызова на вставку или в результате вызова рехэша.

    unordered_map public types

    1. typedeftypenameallocator_type::pointerpointer;

      value_type*, еслиallocator_type::pointerне определен.

    2. typedeftypenameallocator_type::const_pointerconst_pointer;

      boost::pointer_to_other::type, еслиallocator_type::const_pointerне определен.

    3. typedefреализация-определенразмер_тип;

      Неподписанный интегральный тип.

      размер_тип может представлять любое неотрицательное значение разности_тип.

    4. typedefреализация-определенdifference_type;

      Подписанный интегральный тип.

      Идентичен различному типу итератора и const_iterator.

    5. typedefреализация-определенитератор;

      Итератор, типом значения которого является значение_тип.

      Категория итератора является, по крайней мере, передним итератором.

      Конвертируемый в const_iterator.

    6. typedefреализация-определенconst_iterator;

      Постоянный итератор, значением которого является значение_type.

      Категория итератора является, по крайней мере, передним итератором.

    7. typedefреализация-определенлокальный_iterator;

      Итератор с тем же типом значения, типом разности и указателем и эталонным типом, что и итератор.

      Для итерации через одно ведро можно использовать объект local_iterator.

    8. typedefреализация-определенconst_local_iterator;

      Постоянный итератор с тем же типом значений, разностным типом и указателем и эталонным типом, что и const_iterator.

      Объект const_local_iterator может использоваться для итерации через одно ведро.

    unordered_map public construct/copy/destruct

    1. explicit unordered_map(size_type n = implementation-defined, 
                             hasher const& hf = hasher(), 
                             key_equal const& eq = key_equal(), 
                             allocator_type const& a = allocator_type());

      Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0.

      Postconditions:

      size() == 0

      Требуется:

      If the defaults are used, hasher, key_equal and allocator_type need to be DefaultConstructible.

    2. шаблон<имя типа>Итератор ввода,размер_тип,реализация-,[25

      Конструирует пустой контейнер с, по меньшей мере, n ведер, используя hf в качестве хеш-функции, eq в качестве основного предиката равенства, a в качестве распределителя и максимального коэффициента нагрузки 1,0 и вставляет в него элементы из [f, l].

      Требования:

      Требуется:

      If the defaults are used, hasher, key_equal and allocator_type need to be DefaultConstructible.

      [ORIG_END] -->
    3. unordered_map(unordered_map const&);

      The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.

      If Allocator::select_on_container_copy_construction exists and has the right signature, the allocator will be constructed from its result.

      Требуется:

      значение_типявляется копируемым

    4. unordered_map(unordered_map &&);

      The move constructor.

      Примечания:

      This is implemented using Boost.Move.

      Требуется:

      value_type is move constructible.

      On compilers without rvalue reference support the emulation does not support moving without calling boost::move if value_type is not copyable. So, for example, you can't return the container from a function.

    5. эксплицитноunordered_mapРаспределительconst&a;

      Конструирует пустой контейнер, используя распределительa

      .
    6. unordered_mapunordered_mapconst&x,Allocatorconst&a;

      Конструирует контейнер, копируяx's, содержащий элементы, хеш-функцию, предикат, максимальный коэффициент нагрузки, но используя распределительa.

    7. ~unordered_map;

      Примечания:

      The destructor is applied to every element, and all memory is deallocated

      [ORIG_END] -->
    unordered_map& operator=(unordered_map const&);

    Оператор назначения. Копии содержат элементы, хеш-функцию, предикат и максимальный коэффициент нагрузки, но не распределитель.

    ЕслиAlloc::propagate_on_container_copy_assignmentсуществует иAlloc::propagate_on_container_copy_assignment::valueверно, распределитель перезаписан, если не скопированные элементы создаются с использованием существующего распределителя.

    Требуется:

    значение_типявляется копируемым

    unordered_map& operator=(unordered_map &&);

    Оператор переезда.

    ЕслиAlloc::propagate_on_container_move_assignmentсуществует иAlloc::propagate_on_container_move_assignment::valueистинно, распределитель перезаписан, если не перемещаемые элементы создаются с помощью существующего распределителя.

    Примечания:

    На компиляторах без ссылок на значение r это эмулируется с помощью Boost. Пошли. Обратите внимание, что на некоторых компиляторах оператор присвоения копий может использоваться в некоторых обстоятельствах.

    Требуется:

    значение_типявляется подвижным конструируемым.

    allocator_type get_allocator() const;

    unordered_map size and capacity

    Возвращение:

    размерсамого большого возможного контейнера.

    Возврат:

    unordered_map iterators

    1. начинают;const_iteratorначинаютконст;

      Возвращается:

      Итератор, относящийся к первому элементу контейнера, или если контейнер опорожняет значение прошедшего конца для контейнера.
  • ;const_iterator
    Возвращение:

    Итератор, который относится к последнему значению для контейнера.
  • const_iteratorcbeginconst;

    Возвращает:

    Постоянный итератор, относящийся к первому элементу контейнера, или если контейнер опорожняет последнее значение для контейнера.
  • const_iteratorcendconst;

    Возвращение:

    Постоянный итератор, который относится к последнему значению для контейнера.
  • unordered_map modifiers

    1. шаблон<имя типа...Args>std::пара<итератор,bool>Арг...args

      Вставляет объект, построенный с помощью аргументовargs, в контейнер, если и только если в контейнере нет элемента с эквивалентным ключом.

      Требуется:

      value_type is EmplaceConstructible into X from args.

      Returns:

      The bool component of the return type is true if an insert took place.

      If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key.

      Throws:

      If an exception is thrown by an operation other than a call to hasher the function has no effect.

      Примечания:

      Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.

      Pointers and references to elements are never invalidated.

      If the compiler doesn't support variadic template arguments or rvalue references, this is emulated for up to 10 arguments, with no support for rvalue references or move semantics.

      Since existing std::pair implementations don't support std::piecewise_construct this emulates it, but using boost::unordered::piecewise_construct.

      [ORIG_END] -->
    2. шаблон<имя...Арги>итераторemplace_hintconst_iteratorподсказка,Арги&&...args;

      Вставляется объект, построенный с помощью аргументовargs, в контейнер, если и только если в контейнере нет элемента с эквивалентным ключом.

      подсказкаявляется предложением о том, где элемент должен быть вставлен.

      Предписания:

      Требуется:

      value_type is EmplaceConstructible into X from args.

      Returns:

      If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key.

      Throws:

      If an exception is thrown by an operation other than a call to hasher the function has no effect.

      Примечания:

      The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same key.

      Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.

      Pointers and references to elements are never invalidated.

      If the compiler doesn't support variadic template arguments or rvalue references, this is emulated for up to 10 arguments, with no support for rvalue references or move semantics.

      Since existing std::pair implementations don't support std::piecewise_construct this emulates it, but using boost::unordered::piecewise_construct.

      [ORIG_END] -->
    3. std::пара<итератор,bool>вставитьзначение_typeconst&obj;

      Вставляетobjв контейнер, если и только если в контейнере нет элемента с эквивалентным ключом.

      Требуется:

      value_type is CopyInsertable.

      Returns:

      The bool component of the return type is true if an insert took place.

      If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key.

      Throws:

      If an exception is thrown by an operation other than a call to hasher the function has no effect.

      Примечания:

      Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.

      Pointers and references to elements are never invalidated.

      [ORIG_END] -->
    4. std::pair<iterator, bool> insert(value_type&& obj);

      Inserts obj in the container if and only if there is no element in the container with an equivalent key.

      Требуется:

      value_type is MoveInsertable.

      Returns:

      The bool component of the return type is true if an insert took place.

      If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key.

      Throws:

      If an exception is thrown by an operation other than a call to hasher the function has no effect.

      Примечания:

      Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.

      Pointers and references to elements are never invalidated.

    5. iterator insert(const_iterator hint, value_type const& obj);

      Inserts obj in the container if and only if there is no element in the container with an equivalent key.

      hint is a suggestion to where the element should be inserted.

      Требуется:

      value_type is CopyInsertable.

      Returns:

      If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key.

      Throws:

      If an exception is thrown by an operation other than a call to hasher the function has no effect.

      Примечания:

      The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same key.

      Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.

      Pointers and references to elements are never invalidated.

    6. iterator insert(const_iterator hint, value_type&& obj);

      Inserts obj in the container if and only if there is no element in the container with an equivalent key.

      hint is a suggestion to where the element should be inserted.

      Требуется:

      value_type is MoveInsertable.

      Returns:

      If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key.

      Throws:

      If an exception is thrown by an operation other than a call to hasher the function has no effect.

      Примечания:

      The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same key.

      Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.

      Pointers and references to elements are never invalidated.

    7. template<typename InputIterator> 
        void insert(InputIterator first, InputIterator last);

      Inserts a range of elements into the container. Elements are inserted if and only if there is no element in the container with an equivalent key.

      Требуется:

      value_type is EmplaceConstructible into X from *first.

      Throws:

      When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect.

      Примечания:

      Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.

      Pointers and references to elements are never invalidated.

    8. итераторстираетположение const_iterator];

      Удалите элемент, на который указываетположение.

      Возвращение:

      Итератор, следующий заположениемперед стиранием.

      Бросает:

      Только бросает исключение, если его бросаетгашерилиключ_равный.

      Примечания:

      In older versions this could be inefficient because it had to search through several buckets to find the position of the returned iterator. The data structure has been changed so that this is no longer the case, and the alternative erase methods have been deprecated.

      [ORIG_END] -->
    9. size_typeerasekey_typeconst&k;

      Удалите все элементы с ключом, эквивалентнымk.

      Возвращение:

      Число элементов стерто.

      Броски:

      Только бросает исключение, если его бросаетгашерилиключ_равный.

    10. итераторстираетconst_iteratorпервый,const_iteratorпоследний;

      Стирает элементы в диапазоне отпервыйдопоследний.

      Возвращение:

      Итератор, следующий за стертыми элементами — т.е.последний.

      Броски:

      Только бросает исключение, если его бросаетгашерилиключ_равный.

      В этой реализации эта перегрузка не вызывает ни одного из методов объекта функции, поэтому это не бросок, но это может быть не так в других реализациях.

    11. void quick_erase(const_iterator position);

      Erase the element pointed to by position.

      Throws:

      Only throws an exception if it is thrown by hasher or key_equal.

      In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.

      Примечания:

      This method was implemented because returning an iterator to the next element from erase was expensive, but the container has been redesigned so that is no longer the case. So this method is now deprecated.

    12. voiderase_return_voidconst_iterator;

      Удалите элемент, на который указываетположение.

      Броски:

      Только бросает исключение, если его бросаетгашерилиключ_равный.

      В этой реализации эта перегрузка не вызывает ни одного из методов объекта функции, поэтому это не бросок, но это может быть не так в других реализациях.

      Примечания:

      This method was implemented because returning an iterator to the next element from erase was expensive, but the container has been redesigned so that is no longer the case. So this method is now deprecated.

      [ORIG_END] -->
    13. пустотаясно;

      Стирает все элементы в контейнере.

      Постусловия:

      размер() == 0

      Броски:

      Никогда не делайте исключений.

    14. voidswapunordered_map&];

      Заменяет содержимое контейнера параметром.

      ЕслиРаспределитель::propagate_on_container_swapобъявляется иРаспределитель::propagate_on_container_swap::valueявляется истинным, тогда распределители контейнеров меняются. В противном случае обмен неравными распределителями приводит к неопределенному поведению.

      Броски:

      Не выбрасывает исключение, если оно не выброшено конструктором копий или оператором присвоения копий ключа, равнымилихешером.

      Примечания:

      The exception specifications aren't quite the same as the C++11 standard, as the equality predieate and hash function are swapped using their copy constructors.

      [ORIG_END] -->

    unordered_map observers

    1. гашерхэш_функцияконст;

      Возвращение:

      Функция хеширования контейнера.
    2. key_equalkey_eqconst;

      Возвращение:

      Основной предикат равенства контейнера.

    unordered_map lookup

    1. Возвращение:

      Итератор, указывающий на элемент с ключом, эквивалентнымk, илиb.end(), если такой элемент не существует.

      Примечания:

      The templated overloads are a non-standard extensions which allows you to use a compatible hash function and equality predicate for a key of a different type in order to avoid an expensive type cast. In general, its use is not encouraged.

    [ORIG_END] -->
  • размер_типграфключ_типconst&k]const;

    Возвращение:

    Число элементов с ключом, эквивалентнымk.

  • итераторитераторитераторитераторитераторитераторитераторитераторитераторитераторитераторитераторитераторитераторитераторитератор Диапазон, содержащий все элементы с ключом, эквивалентнымk. Если контейнер не содержит таких элементов, возвращаетstd:::make_pair(b.end(),b.end())

  • mapped_type& operator[](key_type const& k);

    Effects:

    If the container does not already contain an elements with a key equivalent to k, inserts the value std::pair<key_type const, mapped_type>(k, mapped_type())

    Returns:

    A reference to x.second where x is the element already in the container, or the newly inserted element with a key equivalent to k

    Throws:

    If an exception is thrown by an operation other than a call to hasher the function has no effect.

    Примечания:

    Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.

    Pointers and references to elements are never invalidated.

  • &ключ_тип&k]k]const&]

    Возвращение:

    Ссылка наx. Second, гдеxявляется (уникальным) элементом, ключ которого эквивалентенk.

    Броски:

    Исключительный объект типаstd::out_of_range, если такой элемент отсутствует.

  • unordered_map bucket interface

    1. size_typebucket_countconst;

      Возвращение:

      Количество ведер.

    2. size_typemax_bucket_countconst

      Возвращение:

      Верхняя граница по количеству ведер.

    3. size_type bucket_size(size_type n) const;

      Требуется:

      n < bucket_count()

      Returns:

      The number of elements in bucket n.

    4. size_typebucketkey_typeconst&k]const;

      Возвращение:

      Индекс ведра, который содержал бы элемент с ключомk.

      Последующие условия:

      Обратная стоимость меньшеbucket_count()

    5. начинаютразмер_типn];const_local_iteratorначинаютразмер_типразмер_типконст

      [!-- [ORIG_BEGIN]

      Требует:

      Требует:

      Требуется:

      n shall be in the range [0, bucket_count()).

      Returns:

      A local iterator pointing the first element in the bucket with index n.

      [ORIG_END] -->
    6. local_iterator end(size_type n);
      const_local_iterator end(size_type n) const;

      Требуется:

      n shall be in the range [0, bucket_count()).

      Returns:

      A local iterator pointing the 'one past the end' element in the bucket with index n.

    7. const_local_iterator cbegin(size_type n) const;

      Требуется:

      n shall be in the range [0, bucket_count()).

      Returns:

      A constant local iterator pointing the first element in the bucket with index n.

    8. const_local_iteratorcendsize_typen;

      Требуется:

      n shall be in the range [0, bucket_count()).

      Returns:

      A constant local iterator pointing the 'one past the end' element in the bucket with index n.

      [ORIG_END] -->

    unordered_map hash policy

    1. плаватьload_factorконст;

      Возвращение:

      Среднее число элементов на ведро.

    2. плаватьmax_load_factor]конст;

      Возвращение:

      Возвращает текущий максимальный коэффициент нагрузки.

    3. voidmax_load_factorfloatz;

      Эффекты:

      Изменяет максимальный коэффициент загрузки контейнера, используяzв качестве подсказки.

    4. voidrehashsize_typen;

      Изменяет количество ведер таким образом, чтобы было не менееnведер, и чтобы коэффициент нагрузки был меньше максимального коэффициента нагрузки.

      Инвалидирует итераторы и изменяет порядок элементов. Указатели и ссылки на элементы не признаются недействительными.

      Броски:

      Функция не имеет эффекта, если забрасывается исключение, если только оно не забрасывается хеш-функцией контейнера или функцией сравнения.

    5. voidreservesize_typen;

      Инвалидирует итераторы и изменяет порядок элементов. Указатели и ссылки на элементы не являются недействительными.

      Броски:

      Функция не имеет эффекта, если забрасывается исключение, если только оно не забрасывается хеш-функцией контейнера или функцией сравнения.

    unordered_map Equality Comparisons

    1. шаблон[шаблон][название][название][название][название][23

      Примечания:

      The behavior of this function was changed to match the C++11 standard in Boost 1.48.

      Behavior is undefined if the two containers don't have equivalent equality predicates.

    [ORIG_END] -->
  • template<typename Key, typename Mapped, typename Hash, typename Pred, 
             typename Alloc> 
      bool operator!=(unordered_map<Key, Mapped, Hash, Pred, Alloc> const& x, 
                      unordered_map<Key, Mapped, Hash, Pred, Alloc> const& y);

    Return false if x.size() == y.size and for every element in x, there is an element in y with the same for the same key, with an equal value (using operator== to compare the value types).

    Примечания:

    The behavior of this function was changed to match the C++11 standard in Boost 1.48.

    Behavior is undefined if the two containers don't have equivalent equality predicates.

  • unordered_map swap

    1. шаблонимя типаимя типаимя типазаменаКлюч,Приставка>],,КлючКлюч,Приставка,ПриставкаРаспределитель::propagate_on_container_swap::valueявляется истинным, тогда распределители контейнеров меняются. В противном случае обмен с неравными распределителями приводит к неопределенному поведению.

      Эффекты:

      x.swap(y)

      Броски:

      Не выбрасывает исключение, если только оно не выброшено конструктором копий или оператором присваивания копийключ_равныйилихешер.

      Примечания:

      The exception specifications aren't quite the same as the C++11 standard, as the equality predieate and hash function are swapped using their copy constructors.

      [ORIG_END] -->

    PrevUpHomeNext

    Статья Class template unordered_map раздела The Boost C++ Libraries BoostBook Documentation Subset Reference может быть полезна для разработчиков на c++ и boost.




    Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



    :: Главная :: Reference ::


    реклама


    ©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
    Top.Mail.Ru

    Время компиляции файла: 2024-08-30 11:47:00
    2025-05-20 05:11:02/0.011162996292114/0