[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/cpp/container/deque/size [Back]  [Original]

std::deque::size cppreference.com
cppreference.com

std::deque::size

cppreference.com

<metanoindex/>

<tbody> </tbody>
size_type size() const;

Returns the number of elements in the container, i.e. std::distance(begin(), end()).

()

:
the number of elements in the container
Google.
. .

noexcept:  
noexcept
  

Constant

The following code uses size to display the number of elements in a std::deque<int>:

#include <deque>
#include <iostream>

int main()
{
    std::deque<int> nums {1, 3, 5, 7};

    std::cout << "nums contains " << nums.size() << " elements.\n";
}

:

nums contains 4 elements.

.

,
(public -) []

(public -) []

(public -) []

Web Proxy Viewer  |  New URL  |  Original Page