libcaf  0.17.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Related Functions | List of all members
caf::cow_tuple< Ts > Class Template Reference

A copy-on-write tuple implementation. More...

#include <cow_tuple.hpp>

Inherits comparable< cow_tuple< Ts...> >, and comparable< cow_tuple< Ts...>, std::tuple< Ts...> >.

Public Types

using impl = detail::tuple_vals< Ts...>
 
using data_type = std::tuple< Ts...>
 

Public Member Functions

 cow_tuple (Ts...xs)
 
 cow_tuple (cow_tuple &&)=default
 
 cow_tuple (const cow_tuple &)=default
 
cow_tupleoperator= (cow_tuple &&)=default
 
cow_tupleoperator= (const cow_tuple &)=default
 
const data_type & data () const noexcept
 Returns the managed tuple.
 
data_type & unshared ()
 Returns a mutable reference to the managed tuple, guaranteed to have a reference count of 1. More...
 
bool unique () const noexcept
 Returns whether the reference count of the managed object is 1.
 
template<class... Us>
int compare (const std::tuple< Us...> &other) const noexcept
 
template<class... Us>
int compare (const cow_tuple< Us...> &other) const noexcept
 

Related Functions

(Note that these are not member functions.)

template<class Inspector , class... Ts>
std::enable_if
< Inspector::reads_state,
typename
Inspector::result_type >::type 
inspect (Inspector &f, const cow_tuple< Ts...> &x)
 
template<class Inspector , class... Ts>
std::enable_if
< Inspector::writes_state,
typename
Inspector::result_type >::type 
inspect (Inspector &f, cow_tuple< Ts...> &x)
 
template<class... Ts>
cow_tuple< typename std::decay
< Ts >::type...> 
make_cow_tuple (Ts &&...xs)
 Creates a new copy-on-write tuple from given arguments.
 
template<size_t N, class... Ts>
auto get (const cow_tuple< Ts...> &xs) -> decltype(std::get< N >(xs.data()))
 Convenience function for calling get<N>(xs.data()).
 

Detailed Description

template<class... Ts>
class caf::cow_tuple< Ts >

A copy-on-write tuple implementation.

Member Function Documentation

template<class... Ts>
data_type& caf::cow_tuple< Ts >::unshared ( )

Returns a mutable reference to the managed tuple, guaranteed to have a reference count of 1.

Friends And Related Function Documentation

template<class Inspector , class... Ts>
std::enable_if< Inspector::reads_state, typename Inspector::result_type >::type inspect ( Inspector &  f,
const cow_tuple< Ts...> &  x 
)
related
template<class Inspector , class... Ts>
std::enable_if< Inspector::writes_state, typename Inspector::result_type >::type inspect ( Inspector &  f,
cow_tuple< Ts...> &  x 
)
related

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