Realistic 3D camera system
3D camera system components
Public Types | Public Member Functions | List of all members
asio::use_future_t< Allocator > Class Template Reference

Class used to specify that an asynchronous operation should return a future. More...

#include <use_future.hpp>

Public Types

typedef Allocator allocator_type

Public Member Functions

ASIO_CONSTEXPR use_future_t ()
 Construct using default-constructed allocator. More...
 use_future_t (const Allocator &allocator)
 Construct using specified allocator. More...
template<typename OtherAllocator >
use_future_t< OtherAllocator > operator[] (const OtherAllocator &allocator) const
 Specify an alternate allocator. More...
allocator_type get_allocator () const
 Obtain allocator. More...

Detailed Description

template<typename Allocator = std::allocator<void>>
class asio::use_future_t< Allocator >

Class used to specify that an asynchronous operation should return a future.

The use_future_t class is used to indicate that an asynchronous operation should return a std::future object. A use_future_t object may be passed as a handler to an asynchronous operation, typically using the special value asio::use_future. For example:

std::future<std::size_t> my_future
= my_socket.async_read_some(my_buffer, asio::use_future);

The initiating function (async_read_some in the above example) returns a future that will receive the result of the operation. If the operation completes with an error_code indicating failure, it is converted into a system_error and passed back to the caller via the future.

Definition at line 41 of file use_future.hpp.

Member Typedef Documentation

template<typename Allocator = std::allocator<void>>
typedef Allocator asio::use_future_t< Allocator >::allocator_type

The allocator type. The allocator is used when constructing the std::promise object for a given asynchronous operation.

Definition at line 46 of file use_future.hpp.

Constructor & Destructor Documentation

template<typename Allocator = std::allocator<void>>
ASIO_CONSTEXPR asio::use_future_t< Allocator >::use_future_t ( )

Construct using default-constructed allocator.

Definition at line 49 of file use_future.hpp.

template<typename Allocator = std::allocator<void>>
asio::use_future_t< Allocator >::use_future_t ( const Allocator &  allocator)

Construct using specified allocator.

Definition at line 54 of file use_future.hpp.

Member Function Documentation

template<typename Allocator = std::allocator<void>>
allocator_type asio::use_future_t< Allocator >::get_allocator ( ) const

Obtain allocator.

Definition at line 67 of file use_future.hpp.

template<typename Allocator = std::allocator<void>>
template<typename OtherAllocator >
use_future_t<OtherAllocator> asio::use_future_t< Allocator >::operator[] ( const OtherAllocator &  allocator) const

Specify an alternate allocator.

Definition at line 61 of file use_future.hpp.

The documentation for this class was generated from the following file: