Seastar
High performance C++ framework for concurrent servers
Public Types | Public Member Functions | List of all members
seastar::reference_wrapper< T > Class Template Reference

Detailed Description

template<typename T>
class seastar::reference_wrapper< T >

Wrapper for lvalue references

reference_wrapper wraps a lvalue reference into a copyable and assignable object. It is very similar to std::reference_wrapper except that it doesn't allow implicit construction from a reference and the only way to construct it is to use either ref() or cref(). The reason for that discrepancy (and also the reason why seastar::reference_wrapper was introduced) is that it server different purpose than std::reference_wrapper. The latter protects references from decaying and allows copying and assigning them. seastar::reference_wrapper is used mainly to force user to explicitly state that object is passed by reference thus reducing the chances that the referred object being prematurely destroyed in case the execution is deferred to a continuation.

#include <seastar/util/reference_wrapper.hh>

Public Types

using type = T
 

Public Member Functions

 operator T& () const noexcept
 
T & get () const noexcept
 

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