GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::priority_queue::size(3) C++ Standard Libary std::priority_queue::size(3)

std::priority_queue::size - std::priority_queue::size


size_type size() const;


Returns the number of elements in the underlying container, that is, c.size().


(none)


The number of elements in the container.


Constant.

// Run this code


#include <algorithm>
#include <iostream>
#include <queue>


int main()
{
std::priority_queue<int> container;


std::cout << "Initially, container.size(): " << container.size() << '\n';


for (int i = 0; i < 7; ++i)
container.push(i);


std::cout << "After adding elements, container.size(): " << container.size() << '\n';
}


Initially, container.size(): 0
After adding elements, container.size(): 7


empty checks whether the underlying container is empty
(public member function)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.