std::set::empty

bool empty() const; Checks if the container has no elements, i.e. whether begin() == end(). Parameters (none). Return value true if the container is empty, false otherwise. Exceptions (none) (until C++11) noexcept specification: noexcept (since C++11) Complexity Constant. Example The following code uses empty to check if a std::set<int> contains any elements: #include <set> #include <iostream> int main() { std::set<int> numbers; std:

std::set::clear

void clear(); Removes all elements from the container. Invalidates any references, pointers, or iterators referring to contained elements. May invalidate any past-the-end iterators. Parameters (none). Return value (none). Exceptions (none) (until C++11) noexcept specification: noexcept (since C++11) Complexity Linear in the size of the container. See also erase erases elements (public member function)

std::set

Defined in header <set> template< class Key, class Compare = std::less<Key>, class Allocator = std::allocator<Key> > class set; std::set is an associative container that contains a sorted set of unique objects of type Key. Sorting is done using the key comparison function Compare. Search, removal, and insertion operations have logarithmic complexity. Sets are usually implemented as red-black trees. Everywhere the standard library uses the Compa

std::seed_seq::size

std::size_t size() const; (since C++11) Returns the size of the stored initial seed sequence. Parameters (none). Return value The size of the private container that was populated at construction time. Complexity Constant time. Exeptions (none) (until C++17) noexcept specification: noexcept (since C++17) Example #include <random> #include <iostream> int main() { std::seed_seq s1 = {-1, 0, 1}; std::cout << s1.size() << '\n'; } Output: 3

std::search_n

Defined in header <algorithm> template< class ForwardIt, class Size, class T > ForwardIt search_n( ForwardIt first, ForwardIt last, Size count, const T& value ); (1) template< class ForwardIt, class Size, class T, class BinaryPredicate > ForwardIt search_n( ForwardIt first, ForwardIt last, Size count, const T& value, BinaryPredicate p ); (2) Searches the range [first, last) for the first sequence of count identical elements, e

std::seed_seq::seed_seq

seed_seq(); (1) (since C++11) seed_seq( const seed_seq& ) = delete; (2) (since C++11) template< class InputIt > seed_seq( InputIt begin, InputIt end ); (3) (since C++11) template< class T > seed_seq( std::initializer_list<T> il ); (4) (since C++11) 1) The default constructor creates a std::seed_seq object with an initial seed sequence of length zero. 2) The copy constructor is deleted: std::seed_seq is not copyable. 3) Constructs a std::seed_se

std::seed_seq::generate

template< class RandomIt > void generate( RandomIt begin, RandomIt end ); (since C++11) Fills the range [begin, end) with unsigned integer values i, 0 ≤ i < 232, based on the data originally provided in the constructor of this seed_seq. The produced values are distributed over the entire 32-bit range even if the initial values were strongly biased. The following algorithm is used (adapted from the initialization sequence of the Mersenne Twister generator by Makoto Matsumoto and

std::seed_seq::param

template< class OutputIt > void param( OutputIt dest ) const; (since C++11) Outputs the initial seed sequence that's stored in the std::seed_seq object. Parameters dest - output iterator such that the expression *dest=rt is valid for a value rt of result_type Type requirements - OutputIt must meet the requirements of OutputIterator. Return value (none). Exceptions Throws only if an operation on dest throws. Example #include <random> #include <ios

std::search

Defined in header <algorithm> template< class ForwardIt1, class ForwardIt2 > ForwardIt1 search( ForwardIt1 first, ForwardIt1 last, ForwardIt2 s_first, ForwardIt2 s_last ); (1) template< class ForwardIt1, class ForwardIt2, class BinaryPredicate > ForwardIt1 search( ForwardIt1 first, ForwardIt1 last, ForwardIt2 s_first, ForwardIt2 s_last, BinaryPredicate p ); (2) Searches for the first occurrence of the subsequence of el

std::seed_seq

Defined in header <random> class seed_seq; (since C++11) std::seed_seq consumes a sequence of integer-valued data and produces a requested number of unsigned integer values i, 0 ≤ i < 232, based on the consumed data. The produced values are distributed over the entire 32-bit range even if the consumed values are close. It provides a way to seed a large number of random number engines or to seed a generator that requires a lot of entropy, given a small seed or a poorly di