A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4659/associative.reqmts below:

[associative.reqmts]

Expression Return type Assertion/note Complexity pre-/post-condition X​::​key_­type Key compile time X​::​mapped_­type (map and multimap only) T compile time X​::​value_­type (set and multiset only) Key Requires:  value_­type is Erasable from X compile time X​::​value_­type (map and multimap only) pair<const Key, T> Requires:  value_­type is Erasable from X compile time X​::​key_­compare Compare Requires:  key_­compare is CopyConstructible. compile time X​::​value_­compare a binary predicate type is the same as key_­compare for set and multiset; is an ordering relation on pairs induced by the first component (i.e., Key) for map and multimap. compile time X​::​node_­type a specialization of a node_­handle class template, such that the public nested types are the same types as the corresponding types in X. see [container.node] compile time X(c)
X u(c); Effects:  Constructs an empty container. Uses a copy of c as a comparison object. constant X()
X u; Requires:  key_­compare is DefaultConstructible.
Effects:  Constructs an empty container. Uses Compare() as a comparison object constant X(i,j,c)
X u(i,j,c); Requires:  value_­type is EmplaceConstructible into X from *i.
Effects:  Constructs an empty container and inserts elements from the range [i, j) into it; uses c as a comparison object. NlogN in general, where N has the value distance(i, j); linear if [i, j) is sorted with value_­comp() X(i,j)
X u(i,j); Requires:  key_­compare is DefaultConstructible. value_­type is EmplaceConstructible into X from *i.
Effects:  Same as above, but uses Compare() as a comparison object. same as above X(il) same as X(il.begin(), il.end()) same as X(il.begin(), il.end()) X(il,c) same as X(il.begin(), il.end(), c) same as X(il.begin(), il.end(), c) a = il X& Requires:  value_­type is CopyInsertable into X and CopyAssignable.
Effects: Assigns the range [il.begin(), il.end()) into a. All existing elements of a are either assigned to or destroyed. NlogN in general, where N has the value il.size() + a.size(); linear if [il.begin(), il.end()) is sorted with value_­comp() b.key_­comp() X​::​key_­compare returns the comparison object out of which b was constructed. constant b.value_­comp() X​::​value_­compare returns an object of value_­compare constructed out of the comparison object constant a_­uniq.​emplace(​args) pair<​iterator, bool> Requires:  value_­type shall be EmplaceConstructible into X from args.
Effects:  Inserts a value_­type object t constructed with std​::​forward<​Args​>(​args)... if and only if there is no element in the container with key equivalent to the key of t. The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of t. logarithmic a_­eq.​emplace(​args) iterator Requires:  value_­type shall be EmplaceConstructible into X from args.
Effects:  Inserts a value_­type object t constructed with std​::​forward<​Args​>(​args)... and returns the iterator pointing to the newly inserted element. If a range containing elements equivalent to t exists in a_­eq, t is inserted at the end of that range. logarithmic a.emplace_­hint(​p, args) iterator equivalent to a.emplace( std​::​forward<​Args​>(​args)...). Return value is an iterator pointing to the element with the key equivalent to the newly inserted element. The element is inserted as close as possible to the position just prior to p. logarithmic in general, but amortized constant if the element is inserted right before p a_­uniq.​insert(​t) pair<​iterator, bool> Requires:  If t is a non-const rvalue expression, value_­type shall be MoveInsertable into X; otherwise, value_­type shall be CopyInsertable into X.
Effects:  Inserts t if and only if there is no element in the container with key equivalent to the key of t. The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of t. logarithmic a_­eq.​insert(​t) iterator Requires:  If t is a non-const rvalue expression, value_­type shall be MoveInsertable into X; otherwise, value_­type shall be CopyInsertable into X.
Effects:  Inserts t and returns the iterator pointing to the newly inserted element. If a range containing elements equivalent to t exists in a_­eq, t is inserted at the end of that range. logarithmic a.​insert(​p, t) iterator Requires:  If t is a non-const rvalue expression, value_­type shall be MoveInsertable into X; otherwise, value_­type shall be CopyInsertable into X.
Effects:  Inserts t if and only if there is no element with key equivalent to the key of t in containers with unique keys; always inserts t in containers with equivalent keys. Always returns the iterator pointing to the element with key equivalent to the key of t. t is inserted as close as possible to the position just prior to p. logarithmic in general, but amortized constant if t is inserted right before p. a.​insert(​i, j) void Requires:  value_­type shall be EmplaceConstructible into X from *i.
Requires: i, j are not iterators into a. inserts each element from the range [i, j) if and only if there is no element with key equivalent to the key of that element in containers with unique keys; always inserts that element in containers with equivalent keys. Nlog(a.size()+N), where N has the value distance(i, j) a.​insert(​il) void equivalent to a.insert(il.begin(), il.end()) a_­uniq.​insert(​nh) insert_­return_­type Requires: nh is empty or a_­uniq.get_­allocator() == nh.get_­allocator().
Effects: If nh is empty, has no effect. Otherwise, inserts the element owned by nh if and only if there is no element in the container with a key equivalent to nh.key().
Postconditions: If nh is empty, inserted is false, position is end(), and node is empty. Otherwise if the insertion took place, inserted is true, position points to the inserted element, and node is empty; if the insertion failed, inserted is false, node has the previous value of nh, and position points to an element with a key equivalent to nh.key(). logarithmic a_­eq.​insert(​nh) iterator Requires: nh is empty or a_­eq.get_­allocator() == nh.get_­allocator().
Effects: If nh is empty, has no effect and returns a_­eq.end(). Otherwise, inserts the element owned by nh and returns an iterator pointing to the newly inserted element. If a range containing elements with keys equivalent to nh.key() exists in a_­eq, the element is inserted at the end of that range.
Postconditions: nh is empty. logarithmic a.​insert(​p, nh) iterator Requires: nh is empty or a.get_­allocator() == nh.get_­allocator().
Effects: If nh is empty, has no effect and returns a.end(). Otherwise, inserts the element owned by nh if and only if there is no element with key equivalent to nh.key() in containers with unique keys; always inserts the element owned by nh in containers with equivalent keys. Always returns the iterator pointing to the element with key equivalent to nh.key(). The element is inserted as close as possible to the position just prior to p.
Postconditions: nh is empty if insertion succeeds, unchanged if insertion fails. logarithmic in general, but amortized constant if the element is inserted right before p. a.​extract(​k) node_­type removes the first element in the container with key equivalent to k. Returns a node_­type owning the element if found, otherwise an empty node_­type. log(a.size()) a.​extract(​q) node_­type removes the element pointed to by q. Returns a node_­type owning that element. amortized constant a.merge(a2) void Requires: a.get_­allocator() == a2.get_­allocator().
Attempts to extract each element in a2 and insert it into a using the comparison object of a. In containers with unique keys, if there is an element in a with key equivalent to the key of an element from a2, then that element is not extracted from a2.
Postconditions: Pointers and references to the transferred elements of a2 refer to those same elements but as members of a. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into a, not into a2.
Throws: Nothing unless the comparison object throws. Nlog(a.size()+N), where N has the value a2.size(). a.erase(k) size_­type erases all elements in the container with key equivalent to k. returns the number of erased elements. log(a.size())+a.count(k) a.erase(q) iterator erases the element pointed to by q. Returns an iterator pointing to the element immediately following q prior to the element being erased. If no such element exists, returns a.end(). amortized constant a.erase(r) iterator erases the element pointed to by r. Returns an iterator pointing to the element immediately following r prior to the element being erased. If no such element exists, returns a.end(). amortized constant a.erase(
q1, q2) iterator erases all the elements in the range [q1, q2). Returns an iterator pointing to the element pointed to by q2 prior to any elements being erased. If no such element exists, a.end() is returned. log(a.size())+N, where N has the value distance(q1, q2). a.clear() void a.erase(a.begin(),a.end())
Postconditions: a.empty() returns true. linear in a.size(). b.find(k) iterator; const_­iterator for constant b. returns an iterator pointing to an element with the key equivalent to k, or b.end() if such an element is not found logarithmic a_­tran.
find(ke) iterator; const_­iterator for constant a_­tran. returns an iterator pointing to an element with key r such that !c(r, ke) && !c(ke, r), or a_­tran.end() if such an element is not found logarithmic b.count(k) size_­type returns the number of elements with key equivalent to k log(b.size())+b.count(k) a_­tran.
count(ke) size_­type returns the number of elements with key r such that !c(r, ke) && !c(ke, r) log(a_tran.size())+a_tran.count(ke) b.lower_­bound(k) iterator; const_­iterator for constant b. returns an iterator pointing to the first element with key not less than k, or b.end() if such an element is not found. logarithmic a_­tran.
lower_­bound(kl) iterator; const_­iterator for constant a_­tran. returns an iterator pointing to the first element with key r such that !c(r, kl), or a_­tran.end() if such an element is not found. logarithmic b.upper_­bound(k) iterator; const_­iterator for constant b. returns an iterator pointing to the first element with key greater than k, or b.end() if such an element is not found. logarithmic a_­tran.
upper_­bound(ku) iterator; const_­iterator for constant a_­tran. returns an iterator pointing to the first element with key r such that c(ku, r), or a_­tran.end() if such an element is not found. logarithmic b.equal_­range(k) pair<​iterator, iterator>; pair<​const_­iterator, const_­iterator> for constant b. equivalent to make_­pair(b.lower_­bound(k), b.upper_­bound(k)). logarithmic a_­tran.
equal_­range(ke) pair<​iterator, iterator>; pair<​const_­iterator, const_­iterator> for constant a_­tran. equivalent to make_­pair(
a_­tran.lower_­bound(ke), a_­tran.upper_­bound(ke)). logarithmic

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4