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::unordered_set::max_bucket_count(3) C++ Standard Libary std::unordered_set::max_bucket_count(3)

std::unordered_set::max_bucket_count - std::unordered_set::max_bucket_count


size_type max_bucket_count() const; (since C++11)


Returns the maximum number of buckets the container is able to hold due to system or
library implementation limitations.


(none)


Maximum number of buckets.


Constant.

// Run this code


#include <iostream>
#include <unordered_set>


int main()
{
struct Ha { std::size_t operator()(long x) const { return std::hash<long>{}(x); }; };


auto c1 = std::unordered_set<char>{};
auto c2 = std::unordered_set<long>{};
auto c3 = std::unordered_set<long, std::hash<int>>{};
auto c4 = std::unordered_set<long, Ha>{};


std::cout
<< "Max bucket count of\n" << std::hex << std::showbase
<< "c1: " << c1.max_bucket_count() << '\n'
<< "c2: " << c2.max_bucket_count() << '\n'
<< "c3: " << c3.max_bucket_count() << '\n'
<< "c4: " << c4.max_bucket_count() << '\n'
;
}


Max bucket count of
c1: 0xfffffffffffffff
c2: 0xfffffffffffffff
c3: 0xfffffffffffffff
c4: 0xaaaaaaaaaaaaaaa


bucket_count returns the number of buckets
(C++11) (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.