std::deque::size(3)
π
std::deque::size(3) β from the C++ Standard Libary manual π
okay bestie, this page is from the C++ Standard Libary manual (yes, thatβs how itβs spelled here), and itβs all about std::deque::size. itβs a tiny icon, itβs useful, and it absolutely ate. no cap. π
πΈ NAME πΈ
std::deque::size β std::deque::size π«Ά
π Synopsis π
size_type size() const; (noexcept since C++11)
Returns the number of elements in the container, i.e. std::distance(begin(), end()). literally just βhow many things are in here?β energy. β¨
π¦ Parameters π¦
(none) β nothing to pass in, bestie. itβs giving low-maintenance. π
π Return value π
The number of elements in the container. thatβs it, thatβs the tea. π
β Complexity β
Constant. periodt. π₯
π Example π
The following code uses size to display the number of elements in a std::deque:
// Run this code
#include <deque>
#include <iostream>
int main()
{
std::deque<int> nums{1, 3, 5, 7};
std::cout << "nums contains " << nums.size() << " elements.\n";
}
π Output π
nums contains 4 elements.
π See also π
emptyβ checks whether the container is empty (public member function)max_sizeβ returns the maximum possible number of elements (public member function)resizeβ changes the number of elements stored (public member function)sizessizeβ returns the size of a container or array(C++17)β (function template)(C++20)
source: http://cppreference.com, version/date: 2024.06.10, page: std::deque::size(3) β mwah, bestie ππ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms