Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::flat_multimap<Key,T,Compare,KeyContainer,MappedContainer>::flat_multimap

      From cppreference.com
      <cpp‎ |container‎ |flat multimap

      [edit template]
       
       
       
      std::flat_multimap
      Member types
      Member functions
      Non-member functions
      Helper classes
      Tags
      Deduction guides
       
      flat_multimap()
         : flat_multimap(key_compare()){}
      (1)(since C++23)
      template<class Allocator>
      flat_multimap(const flat_multimap&,const Allocator& alloc);
      (2)(since C++23)
      template<class Allocator>
      flat_multimap( flat_multimap&&,const Allocator& alloc);
      (3)(since C++23)
      flat_multimap( key_container_type key_cont, mapped_container_type mapped_cont,
                     const key_compare& comp= key_compare());
      (4)(since C++23)
      template<class Allocator>

      flat_multimap(const key_container_type& key_cont,
                     const mapped_container_type& mapped_cont,

                     const Allocator& alloc);
      (5)(since C++23)
      template<class Allocator>

      flat_multimap(const key_container_type& key_cont,
                     const mapped_container_type& mapped_cont,

                     const key_compare& comp,const Allocator& alloc);
      (6)(since C++23)
      flat_multimap(std::sorted_equivalent_t, key_container_type key_cont,

                     mapped_container_type mapped_cont,

                     const key_compare& comp= key_compare());
      (7)(since C++23)
      template<class Allocator>

      flat_multimap(std::sorted_equivalent_t,const key_container_type& key_cont,

                     const mapped_container_type& mapped_cont,const Allocator& alloc);
      (8)(since C++23)
      template<class Allocator>

      flat_multimap(std::sorted_equivalent_t,const key_container_type& key_cont,
                     const mapped_container_type& mapped_cont,

                     const key_compare& comp,const Allocator& alloc);
      (9)(since C++23)
      explicit flat_multimap(const key_compare& comp)
         : c(), compare(comp){}
      (10)(since C++23)
      template<class Allocator>
      flat_multimap(const key_compare& comp,const Allocator& alloc);
      (11)(since C++23)
      template<class Allocator>
      explicit flat_multimap(const Allocator& alloc);
      (12)(since C++23)
      template<class InputIter>

      flat_multimap( InputIter first, InputIter last,
                     const key_compare& comp= key_compare())

         : c(), compare(comp);
      (13)(since C++23)
      template<class InputIter,class Allocator>

      flat_multimap( InputIter first, InputIter last,

                     const key_compare& comp,const Allocator& alloc);
      (14)(since C++23)
      template<class InputIter,class Allocator>
      flat_multimap( InputIter first, InputIter last,const Allocator& alloc);
      (15)(since C++23)
      template<container-compatible-range<value_type> R>

      flat_multimap(std::from_range_t, R&& rg,const key_compare& comp)

         : flat_multimap(comp);
      (16)(since C++23)
      template<container-compatible-range<value_type> R>

      flat_multimap(std::from_range_t fr, R&& rg)

         : flat_multimap(fr,std::forward<R>(rg), key_compare()){}
      (17)(since C++23)
      template<container-compatible-range<value_type> R,class Allocator>
      flat_multimap(std::from_range_t, R&& rg,const Allocator& alloc);
      (18)(since C++23)
      template<container-compatible-range<value_type> R,class Allocator>

      flat_multimap(std::from_range_t, R&& rg,const key_compare& comp,

                     const Allocator& alloc);
      (19)(since C++23)
      template<class InputIter>

      flat_multimap(std::sorted_equivalent_t s, InputIter first, InputIter last,
                     const key_compare& comp= key_compare())

         : c(), compare(comp);
      (20)(since C++23)
      template<class InputIter,class Allocator>

      flat_multimap(std::sorted_equivalent_t s, InputIter first, InputIter last,

                     const key_compare& comp,const Allocator& alloc);
      (21)(since C++23)
      template<class InputIter,class Allocator>

      flat_multimap(std::sorted_equivalent_t s, InputIter first, InputIter last,

                     const Allocator& alloc);
      (22)(since C++23)
      flat_multimap(std::initializer_list<value_type> init,

                     const key_compare& comp= key_compare())

         : flat_multimap(init.begin(), init.end(), comp){}
      (23)(since C++23)
      template<class Allocator>

      flat_multimap(std::initializer_list<value_type> init,const key_compare& comp,

                     const Allocator& alloc);
      (24)(since C++23)
      template<class Allocator>
      flat_multimap(std::initializer_list<value_type> init,const Allocator& alloc);
      (25)(since C++23)
      flat_multimap(std::sorted_equivalent_t s,std::initializer_list<value_type> init,

                     const key_compare& comp= key_compare())

         : flat_multimap(s, init.begin(), init.end(), comp){}
      (26)(since C++23)
      template<class Allocator>

      flat_multimap(std::sorted_equivalent_t s,std::initializer_list<value_type> init,

                     const key_compare& comp,const Allocator& alloc);
      (27)(since C++23)
      template<class Allocator>

      flat_multimap(std::sorted_equivalent_t s,std::initializer_list<value_type> init,

                     const Allocator& alloc);
      (28)(since C++23)

      Constructs new container adaptor from a variety of data sources and optionally using user supplied comparison function objectcomp and/or allocatoralloc.

      1) A default constructor. Constructs an empty container adaptor.
      2) Acopy constructor. Constructsc with the copy of the contents ofother.c andcompare withother.compare.Seeallocator usage note below.
      3) Amove constructor. Constructs the container adaptor with the contents ofother using move semantics.Seeallocator usage note below.
      4) First, initializesc.keys withstd::move(key_cont),c.values withstd::move(mapped_cont), andcompare withcomp. Then sorts the underlying range[begin()end()) with respect tovalue_comp().
      5) Same as(4), equivalent toflat_multimap(key_cont, mapped_cont);.Seeallocator usage note below.
      6) Same as(4), equivalent toflat_multimap(key_cont, mapped_cont, comp);.Seeallocator usage note below.
      7) Initializesc.keys withstd::move(key_cont),c.values withstd::move(mapped_cont), andcompare withcomp.
      8) Same as(7), equivalent toflat_multimap(s, key_cont, mapped_cont);.Seeallocator usage note below.
      9) Same as(7), equivalent toflat_multimap(s, key_cont, mapped_cont, comp);.Seeallocator usage note below.
      10) Constructs an empty container adaptor.
      11,12) Constructs an empty container adaptor.Seeallocator usage note below.
      13) Constructs the container adaptor with the contents of the range[firstlast), equivalent toinsert(first, last);.
      14,15) Same as(13).Seeallocator usage note below.
      16) Constructs the container adaptor with the contents of the rangerg. First, uses(10) asdelegating constructor. Then initializesc with the contents ofrg as if byinsert_range(std::forward<R>(rg));.
      17) Same as(16) using it asdelegating constructor.
      18,19) Same as(16).Seeallocator usage note below.
      20) Constructs the underlying containers with the contents of the range[firstlast) as if byinsert(first, last).
      21,22) Same as(20).Seeallocator usage note below.
      23) Aninitializer-list constructor. Constructs the underlying container with the contents of the initializer listinit, using(13) asdelegating constructor.
      24,25) Same as(23).Seeallocator usage note below.
      26) Aninitializer-list constructor. Constructs the underlying container with the contents of the initializer listinit, using(20) asdelegating constructor.
      27,28) Save as(26).Seeallocator usage note below.

      Note for overloads(13-15,20-22): If[firstlast) is not avalid range, the behavior is undefined.

      Contents

      [edit]Allocator usage note

      The constructors(2,3,5,6,8,9,11,12,14,15,17,19,21,22,24,25,27,28) are equivalent to the corresponding non-allocator constructors except that the underlying containersc.keys andc.values are constructed withuses-allocator construction.These overloads participate in overload resolution only ifstd::uses_allocator_v<container_type, Allocator> istrue.

      [edit]Parameters

      key_cont - a container to be used as source to initialize the underlying keys container
      mapped_cont - a container to be used as source to initialize the underlying values container
      other - anotherflat_multimap to be used as source to initialize the elements of the underlying containers with
      alloc - an allocator to use for all memory allocations of the underlying containers
      comp - a function object to be used for all comparisons of keys
      first, last - the pair of iterators defining the sourcerange of elements to copy
      init - an initializer list to initialize the elements of the underlying containers with
      rg - acontainer compatible range (that is, aninput_range whose elements are convertible tovalue_type) to be used as source to initialize the underlying containers
      fr - adisambiguation tag that indicates that the contained member should be range constructed
      s - adisambiguation tag that indicates that the input sequence is sorted with respect tovalue_comp()
      Type requirements
      -
      InputIt must meet the requirements ofLegacyInputIterator.
      -
      Compare must meet the requirements ofCompare.
      -
      Allocator must meet the requirements ofAllocator.

      [edit]Complexity

      1) Constant.
      2) Linear in size ofother.
      3) Same as the corresponding move-constructor of the wrapped container, i.e. constant or linear in size ofcont.
      4-6) Linear in\(\scriptsize N\)N ifcont is sorted with respect tovalue_comp(), otherwise\(\scriptsize \mathcal{O}(N\cdot\log{(N)})\)𝓞(N·log(N)), where\(\scriptsize N\)N is the value ofkey_cont.size() before this call.
      7-9) Same as the corresponding move-constructor of the wrapped container, i.e. constant or linear in size ofcont.
      10-12) Constant.
      13-15) Linear in\(\scriptsize N\)N if the input range[firstlast) is sorted with respect tovalue_comp(), otherwise\(\scriptsize \mathcal{O}(N\cdot\log{(N)})\)𝓞(N·log(N)), where\(\scriptsize N\)N is the value ofkey_cont.size() before this call.
      16-19) Linear in\(\scriptsize N\)N if the input rangerg is sorted with respect tovalue_comp(), otherwise\(\scriptsize \mathcal{O}(N\cdot\log{(N)})\)𝓞(N·log(N)), where\(\scriptsize N\)N is the value ofkey_cont.size() before this call.
      20-22) Linear in size of[firstlast).
      23-25) Linear in\(\scriptsize N\)N if the elements ofinit are sorted with respect tovalue_comp(), otherwise\(\scriptsize \mathcal{O}(N\cdot\log{(N)})\)𝓞(N·log(N)), where\(\scriptsize N\)N is the value ofkey_cont.size() before this call.
      26-28) Linear in size ofinit.

      [edit]Exceptions

      Calls toAllocator::allocate may throw.

      [edit]Notes

      After container move construction (overload(3)), references, pointers, and iterators (other than the end iterator) toother remain valid, but refer to elements that are now in*this. The current standard makes this guarantee via the blanket statement in[container.reqmts]/67, and a more direct guarantee is under consideration viaLWG issue 2321.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      assigns values to the container adaptor
      (public member function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/container/flat_multimap/flat_multimap&oldid=171864"

      [8]ページ先頭

      ©2009-2025 Movatter.jp