std::upper_bound

Defined in header <algorithm> template< class ForwardIt, class T > ForwardIt upper_bound( ForwardIt first, ForwardIt last, const T& value ); (1) template< class ForwardIt, class T, class Compare > ForwardIt upper_bound( ForwardIt first, ForwardIt last, const T& value, Compare comp ); (2) Returns an iterator pointing to the first element in the range [first, last) that is greater than value. The range [first, last) must be at least partially ordered

std::uppercase

Defined in header <ios> std::ios_base& uppercase( std::ios_base& str ); (1) std::ios_base& nouppercase( std::ios_base& str ); (2) Enables the use of uppercase characters in floating-point and hexadecimal integer output. Has no effect on input. 1) enables the uppercase flag in the stream str as if by calling str.setf(std::ios_base::uppercase). 2) disables the uppercase flag in the stream str as if by calling str.unsetf(std::ios_base::uppercase). This is

std::unordered_set::unordered_set

(1) explicit unordered_set( size_type bucket_count = /*implementation-defined*/, const Hash& hash = Hash(), const KeyEqual& equal = KeyEqual(), const Allocator& alloc = Allocator() ); (since C++11) (until C++14) unordered_set() : unordered_set( size_type(/*implementation-defined*/) {} explicit unordered_set( size_type bucket_count, const Hash& hash = Hash(),

std::unordered_set::swap

void swap( unordered_set& other ); (since C++11) Exchanges the contents of the container with those of other. Does not invoke any move, copy, or swap operations on individual elements. All iterators and references remain valid. The past-the-end iterator is invalidated. The Hash and KeyEqual objects must be Swappable, and they are exchanged using unqualified calls to non-member swap. If std::allocator_traits<allocator_type>::propagate_on_container_swap::value is true, then the

std::unordered_set::size

size_type size() const; (since C++11) Returns the number of elements in the container, i.e. std::distance(begin(), end()). Parameters (none). Return value The number of elements in the container. Exceptions noexcept specification: noexcept Complexity Constant. Example The following code uses size to display the number of elements in a std::unordered_set<int>: #include <unordered_set> #include <iostream> int main() { std::unordered_set<int>

std::unordered_set::reserve

void reserve( size_type count ); (since C++11) Sets the number of buckets to the number needed to accomodate at least count elements without exceeding maximum load factor and rehashes the container, i.e. puts the elements into appropriate buckets considering that total number of buckets has changed. Effectively calls rehash(std::ceil(count / max_load_factor())). Parameters count - new capacity of the container Return value (none). Complexity Average case linear in the s

std::unordered_set::rehash

void rehash( size_type count ); (since C++11) Sets the number of buckets to count and rehashes the container, i.e. puts the elements into appropriate buckets considering that total number of buckets has changed. If the new number of buckets makes load factor more than maximum load factor (count < size() / max_load_factor()), then the new number of buckets is at least size() / max_load_factor(). Parameters count - new number of buckets Return value (none). Complexity

std::unordered_set::max_size

size_type max_size() const; (since C++11) Returns the maximum number of elements the container is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest container. Parameters (none). Return value Maximum number of elements. Exceptions noexcept specification: noexcept Complexity Constant. Notes This value is typically equal to std::numeric_limits<size_type>::max(), and reflects the theoretical limit on t

std::unordered_set::max_load_factor

float max_load_factor() const; (1) (since C++11) void max_load_factor( float ml ); (2) (since C++11) Manages the maximum load factor (number of elements per bucket). The container automatically increases the number of buckets if the load factor exceeds this threshold. 1) Returns current maximum load factor. 2) Sets the maximum load factor to ml. Parameters ml - new maximum load factor setting Return value 1) current maximum load factor. 2) none. Complexity Constan

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. Parameters (none). Return value Maximum number of buckets. Complexity Constant. See also bucket_count returns the number of buckets (public member function)