std::promise

Defined in header <future> template< class R > class promise; (1) (since C++11) template< class R > class promise<R&>; (2) (since C++11) template<> class promise<void>; (3) (since C++11) 1) base template 2) non-void specialization, used to communicate objects between threads 3) void specialization, used to communicate stateless events The class template std::promise provides a facility to store a value or an exceptio

std::proj(std::complex)

Defined in header <complex> template< class T > complex<T> proj( const complex<T>& z ); (1) (since C++11) std::complex<long double> proj( long double z ); (2) (since C++11) template< class DoubleOrIngeter > std::complex<double> proj( DoubleOrInteger z ); (3) (since C++11) std::complex<float> proj( float z ); (4) (since C++11) Returns the projection of the complex number z onto the Riemann sphere. For most z, s

std::priority_queue::top

const_reference top() const; Returns reference to the top element in the priority queue. This element will be removed on a call to pop(). If default comparison function is used, the returned element is also the greatest among the elements in the queue. Parameters (none). Return value Reference to the top element as if obtained by a call to c.front(). Complexity Constant. See also pop removes the top element (public member function)

std::priority_queue::swap

void swap( priority_queue& other ); (since C++11) Exchanges the contents of the container adaptor with those of other. Effectively calls using std::swap; swap(c, other.c); swap(comp, other.comp); Parameters other - container adaptor to exchange the contents with Return value (none). Exceptions noexcept specification: noexcept(noexcept(std::swap(c, other.c)) && noexcept(std::swap(comp, other.comp))) Complexity Same as underlying container (typically cons

std::priority_queue::size

size_type size() const; Returns the number of elements in the underlying container, that is, c.size(). Parameters (none). Return value The number of elements in the container. Complexity Constant. See also empty checks whether the underlying container is empty (public member function)

std::priority_queue::push

void push( const T& value ); void push( T&& value ); (since C++11) Pushes the given element value to the priority queue. 1) Effectively calls c.push_back(value); std::push_heap(c.begin(), c.end(), comp); 2) Effectively calls c.push_back(std::move(value)); std::push_heap(c.begin(), c.end(), comp); Parameters value - the value of the element to push Return value (none). Complexity Logarithmic number of comparisons plus the complexity of Container::pu

std::priority_queue::priority_queue

(1) explicit priority_queue( const Compare& compare = Compare(), const Container& cont = Container() ); (until C++11) priority_queue( const Compare& compare, const Container& cont ); (since C++11) explicit priority_queue( const Compare& compare = Compare(), Container&& cont = Container() ); (2) (since C++11) priority_queue( const priority_queue& other ); (3) priority_queue( priority_queue&

std::priority_queue::pop

void pop(); Removes the top element from the priority queue. Effectively calls std::pop_heap(c.begin(), c.end(), comp); c.pop_back(); Parameters (none). Return value (none). Complexity Logarithmic number of comparisons plus the complexity of Container::pop_back. See also emplace (C++11) constructs element in-place and sorts the underlying container (public member function) push inserts element and sorts the underlying container (public member function) top ac

std::priority_queue::empty

bool empty() const; Checks if the underlying container has no elements, i.e. whether c.empty(). Parameters (none). Return value true if the underlying container is empty, false otherwise. Complexity Constant. See also size returns the number of elements (public member function)

std::priority_queue::emplace

template< class... Args > void emplace( Args&&... args ); (since C++11) Pushes new element to the priority queue. The element is constructed in-place, i.e. no copy or move operations are performed. The constructor of the element is called with exactly the same arguments as supplied to the function. Effectively calls c.emplace_back(std::forward<Args>(args)...); std::push_heap(c.begin(), c.end(), comp); Parameters args - arguments to forward to the constructor