libqi-api  2.8.7.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
qi::UnitFuture Struct Reference

#include <future_fwd.hpp>

Public Types

using retract_type = SrcFuture
 

Public Member Functions

 UnitFuture ()
 
template<typename T >
Future< ka::Decay< T > > operator() (T &&t) const
 There is no constraint on T. More...
 
Future< void > operator() () const
 

Detailed Description

Polymorphic function object that creates a Future from a value, if provided.

"unit" is traditionally the name of a transformation that sends a value into the monadic level, because it is a "unit" or "neutral element" for monadic composition.

See the comment of semiLift for an explanation.

Example:

// `i` is an `int`
Future<int> fut0 = unit(i);
Future<void> fut1 = unit();

Definition at line 1119 of file future_fwd.hpp.

Member Typedef Documentation

Definition at line 1144 of file future_fwd.hpp.

Constructor & Destructor Documentation

qi::UnitFuture::UnitFuture ( )
inline

Definition at line 1124 of file future_fwd.hpp.

Member Function Documentation

template<typename T >
Future<ka::Decay<T> > qi::UnitFuture::operator() ( T &&  t) const
inline

There is no constraint on T.

Definition at line 1132 of file future_fwd.hpp.

Future<void> qi::UnitFuture::operator() ( ) const
inline

Definition at line 1137 of file future_fwd.hpp.


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