std::unique_lock::lock

void lock(); (since C++11) Locks the associated mutex. Effectively calls mutex()->lock(). Parameters (none). Return value (none). Exceptions Any exceptions thrown by mutex()->lock() If there is no associated mutex, std::system_error with an error code of std::errc::operation_not_permitted If the mutex is already locked by this unique_lock (in other words, owns_lock is true), std::system_error with an error code of std::errc::resource_deadlock_would_occur Example

std::unique_lock::owns_lock

bool owns_lock() const; (since C++11) Checks whether *this owns a locked mutex or not. Parameters (none). Return value true if *this has an associated mutex and has acquired ownership of it, false otherwise. Exceptions noexcept specification: noexcept See also operator bool tests whether the lock owns its associated mutex (public member function)

std::unique_lock

Defined in header <mutex> template< class Mutex > class unique_lock; (since C++11) The class unique_lock is a general-purpose mutex ownership wrapper allowing deferred locking, time-constrained attempts at locking, recursive locking, transfer of lock ownership, and use with condition variables. The class unique_lock is movable, but not copyable -- it meets the requirements of MoveConstructible and MoveAssignable but not of CopyConstructible or CopyAssignable. The clas

std::unique_lock::operator bool

explicit operator bool() const; (since C++11) Checks whether *this owns a locked mutex or not. Effectively calls owns_lock(). Parameters (none). Return value true if *this has an associated mutex and has acquired ownership of it, false otherwise. Exceptions noexcept specification: noexcept See also owns_lock tests whether the lock owns its associated mutex (public member function)

std::unique_copy

Defined in header <algorithm> template< class InputIt, class OutputIt > OutputIt unique_copy( InputIt first, InputIt last, OutputIt d_first ); (1) template< class InputIt, class OutputIt, class BinaryPredicate > OutputIt unique_copy( InputIt first, InputIt last, OutputIt d_first, BinaryPredicate p ); (2) Copies the elements from the range [first, last), to another range beginning at d_first in such a way that the

std::uninitialized_fill_n

Defined in header <memory> template< class ForwardIt, class Size, class T > void uninitialized_fill_n( ForwardIt first, Size count, const T& value ); (until C++11) template< class ForwardIt, class Size, class T > ForwardIt uninitialized_fill_n( ForwardIt first, Size count, const T& value ); (since C++11) Copies the given value value to the first count elements in an uninitialized memory area beginning at first as if by. for (; n--; ++first) ::new

std::unique

Defined in header <algorithm> template< class ForwardIt > ForwardIt unique( ForwardIt first, ForwardIt last ); (1) template< class ForwardIt, class BinaryPredicate > ForwardIt unique( ForwardIt first, ForwardIt last, BinaryPredicate p ); (2) Removes all consecutive duplicate elements from the range [first, last) and returns a past-the-end iterator for the new logical end of the range. The first version uses operator== to compare the elements, the second ve

std::uninitialized_fill

Defined in header <memory> template< class ForwardIt, class T > void uninitialized_fill( ForwardIt first, ForwardIt last, const T& value ); Copies the given value to an uninitialized memory area, defined by the range [first, last) as if by. for (; first != last; ++first) ::new (static_cast<void*>(std::addressof(*first))) typename iterator_traits<ForwardIterator>::value_type(x); If an exception is thrown during the initialization, the function h

std::uninitialized_copy

Defined in header <memory> template< class InputIt, class ForwardIt > ForwardIt uninitialized_copy( InputIt first, InputIt last, ForwardIt d_first ); Copies elements from the range [first, last) to an uninitialized memory area beginning at d_first as if by. for (; first != last; ++d_first, (void) ++first) ::new (static_cast<void*>(std::addressof(*d_first))) typename iterator_traits<ForwardIterator>::value_type(*first); If an exception is thrown du

std::uninitialized_copy_n

Defined in header <memory> template< class InputIt, class Size, class ForwardIt > ForwardIt uninitialized_copy_n( InputIt first, Size count, ForwardIt d_first); (since C++11) Copies count elements from a range beginning at first to an uninitialized memory area beginning at d_first as if by. for ( ; n > 0; ++d_first, (void) ++first, --n) ::new (static_cast<void*>(std::addressof(*d_first))) typename iterator_traits<ForwardIterator>::value_type(*f