std::future

Defined in header <future> template< class T > class future; (1) (since C++11) template< class T > class future<T&>; (2) (since C++11) template<> class future<void>; (3) (since C++11) The class template std::future provides a mechanism to access the result of asynchronous operations: An asynchronous operation (created via std::async, std::packaged_task, or std::promise) can provide a std::future object to the creator o

std::function::operator bool

explicit operator bool() const; (since C++11) Checks whether *this stores a callable function target, i.e. is not empty. Parameters (none). Return value true if *this stores a callable function target, false otherwise. Exceptions noexcept specification: noexcept Example #include <functional> #include <iostream> void sampleFunction() { std::cout << "This is the sample function!\n"; } void checkFunc( std::function<void()> &func ) { /

std::function::function

function(); (1) (since C++11) function( std::nullptr_t ); (2) (since C++11) function( const function& other ); (3) (since C++11) function( function&& other ); (4) (since C++11) template< class F > function( F f ); (5) (since C++11) template< class Alloc > function( std::allocator_arg_t, const Alloc& alloc ); (6) (since C++11) template< class Alloc > function( std::allocator_arg_t, const Alloc& alloc, std::n

std::function::target_type

const std::type_info& target_type() const; (since C++11) Returns the type of the stored function. Parameters (none). Return value typeid(T) if the stored function has type T, otherwise typeid(void). Exceptions noexcept specification: noexcept Example #include <functional> #include <iostream> int f(int a) { return -a; } int main() { // fn1 and fn2 have the same type, but their targets do not std::function<int(int)> fn1(f),

std::function::swap

void swap( function& other ); (since C++11) Exchanges the stored callable objects of *this and other. Parameters other - function wrapper to exchange the stored callable object with Return value (none). Exceptions noexcept specification: noexcept

std::function::target

template< class T > T* target(); (1) (since C++11) template< class T > const T* target() const; (2) (since C++11) Returns a pointer to the stored callable function target. Parameters (none). Return value A pointer to the stored function if target_type() == typeid(T), otherwise a null pointer. Exceptions noexcept specification: noexcept Example #include <functional> #include <iostream> int f(int, int) { return 1; } int g(int, int) { retur

std::ftell

Defined in header <cstdio> long ftell( std::FILE* stream ); Returns the current value of the file position indicator for the file stream stream. If the stream is open in binary mode, the value obtained by this function is the number of bytes from the beginning of the file. If the stream is open in text mode, the value returned by this function is unspecified and is only meaningful as the input to std::fseek. Parameters stream - file stream to examine Return val

std::function

Defined in header <functional> template< class > class function; /* undefined */ (since C++11) template< class R, class... Args > class function<R(Args...)> (since C++11) Class template std::function is a general-purpose polymorphic function wrapper. Instances of std::function can store, copy, and invoke any Callable target -- functions, lambda expressions, bind expressions, or other function objects, as well as pointers to member functions and point

std::fsetpos

Defined in header <cstdio> int fsetpos( std::FILE* stream, const std::fpos_t* pos ); Sets the file position indicator and the multibyte parsing state (if any) for the C file stream stream according to the value pointed to by pos. Besides establishing new parse state and position, a call to this function undoes the effects of std::ungetc and clears the end-of-file state, if it is set. If a read or write error occurs, the error indicator (std::ferror)for the stream is set.

std::function::assign

template< class F, class Alloc > void assign( F&& f, const Alloc& alloc ); (since C++11) (until C++17) Initializes the target with f. alloc is used to allocate memory for any internal data structures that the function might use. Equivalent to function(allocator_arg, alloc, std::forward<F>(f)).swap(*this). Parameters f - callable function to initialize the target with alloc - allocator to use to allocate memory for the internal data structures R