A RetroSearch Logo

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

Search Query:

Showing content from https://cplusplus.github.io/LWG/issue3028 below:

Container requirements tables should distinguish const and non-const variables

  X u(av);
  X u = av;

-12- Preconditions: T is Cpp17CopyInsertable into X (see below).

-13- Postconditions: u == a v.

-14- Complexity: Linear.

  X u(rv);
  X u = rv;

-15- Postconditions: u is equal to the value that rv had before this construction.

-14- Complexity: Linear for array and constant for all other standard containers.

  t = v

-?- Result: X&.

-?- Postconditions: t == v.

-?- Complexity: Linear.

  at = rv

-17- Result: X&.

-18- Effects: All existing elements of a t are either move assigned to or destroyed.

-19- Postconditions: a t shall be equal to the value that rv had before this assignment.

-20- Complexity: Linear.

[…]

  ab.begin()

-24- Result: iterator; const_iterator for constant a b.

-25- Returns: An iterator referring to the first element in the container.

-26- Complexity: Constant.

  ab.end()

-27- Result: iterator; const_iterator for constant a b.

-28- Returns: An iterator which is the past-the-end value for the container.

-29- Complexity: Constant.

  ab.cbegin()

-30- Result: const_iterator.

-31- Returns: const_cast<X const&>( a b).begin()

-32- Complexity: Constant.

  ab.cend()

-33- Result: const_iterator.

-34- Returns: const_cast<X const&>( a b).end()

-35- Complexity: Constant.

[…]

  ac == b

-39- Preconditions: T meets the Cpp17EqualityComparable requirements.

-40- Result: Convertible to bool.

-41- Returns: equal( a c.begin(), a c.end(), b.begin(), b.end()).

        [Note 1: The algorithm equal is defined in 26.6.13 [alg.equal]. — end note]

-42- Complexity: Constant if a c.size() != b.size(), linear otherwise.

-43- Remarks: == is an equivalence relation.

  ac != b

-44- Effects: Equivalent to !( a c == b).

  at.swap(bs)

-45- Result: void.

-46- Effects: Exchanges the contents of a t and b s.

-47- Complexity: Linear for array and constant for all other standard containers.

  swap(at, bs)

-48- Effects: Equivalent to a t.swap( b s)

  r = a

-49- Result: X&.

-50- Postconditions: r == a.

-51- Complexity: Linear.

  ac.size()

-52- Result: size_type.

-53- Returns: distance( a c.begin(), a c.end()), i.e. the number of elements in the container.

-54- Complexity: Constant.

-55- Remarks: The number of elements is defined by the rules of constructors, inserts, and erases.

  ac.max_size()

-56- Result: size_type.

-57- Returns: distance(begin(), end()) for the largest possible container.

-58- Complexity: Constant.

  ac.empty()

-59- Result: Convertible to bool.

-60- Returns: a c.begin() == a c.end())

-61- Complexity: Constant.

-62- Remarks: If the container is empty, then a c.empty() is true.


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