Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
tuple.hpp File Reference
#include <fc/utility.hpp>
#include <boost/preprocessor/repeat.hpp>
#include <boost/preprocessor/repeat_from_to.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/facilities/empty.hpp>
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
Include dependency graph for tuple.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fc::tuple<>
 
struct  fc::tuple<>
 
struct  fc::is_tuple< T >
 

Namespaces

namespace  fc
 namespace sysio::chain
 

Macros

#define RREF_PARAMS(z, n, data)
 
#define ILIST_PARAMS(z, n, data)
 
#define ILIST_PARAMS_COPY(z, n, data)
 
#define VISIT_PARAMS(z, n, data)
 
#define LIST_MEMBERS_ON(z, n, data)
 
#define DEDUCE_MEMBERS(z, n, data)
 
#define FORWARD_PARAMS(z, n, data)
 
#define MEM_PARAMS(z, n, data)
 
#define TUPLE(z, n, unused)
 

Functions

template<typename Functor >
auto fc::call_fused (Functor f, const tuple<> &t) -> decltype(f())
 
tuple fc::make_tuple ()
 

Macro Definition Documentation

◆ DEDUCE_MEMBERS

#define DEDUCE_MEMBERS ( z,
n,
data )
Value:
typename fc::deduce<BOOST_PP_CAT(AA,n)>::type

Definition at line 80 of file tuple.hpp.

◆ FORWARD_PARAMS

#define FORWARD_PARAMS ( z,
n,
data )
Value:
fc::forward<BOOST_PP_CAT(AA,n)>(BOOST_PP_CAT(p,n))
const mie::Vuint & p
Definition bn.cpp:27

Definition at line 81 of file tuple.hpp.

◆ ILIST_PARAMS

#define ILIST_PARAMS ( z,
n,
data )
Value:
BOOST_PP_CAT(a,n)( fc::forward<BOOST_PP_CAT(AA,n)>( BOOST_PP_CAT(p,n) ) )
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181

Definition at line 76 of file tuple.hpp.

◆ ILIST_PARAMS_COPY

#define ILIST_PARAMS_COPY ( z,
n,
data )
Value:
BOOST_PP_CAT(a,n)( t.BOOST_PP_CAT(a,n) )

Definition at line 77 of file tuple.hpp.

◆ LIST_MEMBERS_ON

#define LIST_MEMBERS_ON ( z,
n,
data )
Value:
data.BOOST_PP_CAT(a,n)

Definition at line 79 of file tuple.hpp.

◆ MEM_PARAMS

#define MEM_PARAMS ( z,
n,
data )
Value:
BOOST_PP_CAT(A,n) BOOST_PP_CAT(a,n);

Definition at line 82 of file tuple.hpp.

◆ RREF_PARAMS

#define RREF_PARAMS ( z,
n,
data )
Value:
BOOST_PP_CAT(AA,n)&& BOOST_PP_CAT(p,n)

Definition at line 75 of file tuple.hpp.

◆ TUPLE

#define TUPLE ( z,
n,
unused )

Definition at line 83 of file tuple.hpp.

83 #define TUPLE(z,n,unused) \
84 template<BOOST_PP_ENUM_PARAMS( n, typename A)> \
85 struct tuple<BOOST_PP_ENUM_PARAMS(n,A)> { \
86 enum size_enum { size = n }; \
87 template<BOOST_PP_ENUM_PARAMS( n, typename AA)> \
88 explicit tuple( BOOST_PP_ENUM(n, RREF_PARAMS, unused ) )BOOST_PP_IF(n,:,BOOST_PP_EMPTY())BOOST_PP_ENUM( n, ILIST_PARAMS,unused){} \
89 tuple( const tuple& t )BOOST_PP_IF(n,:,BOOST_PP_EMPTY())BOOST_PP_ENUM( n, ILIST_PARAMS_COPY,unused){} \
90 tuple( tuple&& t )BOOST_PP_IF(n,:,BOOST_PP_EMPTY())BOOST_PP_ENUM( n, ILIST_PARAMS_COPY,unused){} \
91 tuple(){}\
92 template<typename V>\
93 void visit( V&& v ) { BOOST_PP_REPEAT(n,VISIT_PARAMS,a) }\
94 template<typename V>\
95 void visit( V&& v )const { BOOST_PP_REPEAT(n,VISIT_PARAMS,a) }\
96 BOOST_PP_REPEAT(n,MEM_PARAMS,a) \
97 }; \
98 template<BOOST_PP_ENUM_PARAMS( n, typename AA)> \
99 tuple<BOOST_PP_ENUM_PARAMS(n,AA)> make_tuple( BOOST_PP_ENUM( n, RREF_PARAMS, unused) ) { \
100 return tuple<BOOST_PP_ENUM_PARAMS(n,AA)>( BOOST_PP_ENUM( n, FORWARD_PARAMS,unused ) ); \
101 } \
102 template<typename Functor, BOOST_PP_ENUM_PARAMS(n,typename AA)> \
103 auto call_fused( Functor f, tuple<BOOST_PP_ENUM_PARAMS(n,AA)>& t ) \
104 -> decltype( f( BOOST_PP_ENUM( n, LIST_MEMBERS_ON, t) ) ) { \
105 return f( BOOST_PP_ENUM( n, LIST_MEMBERS_ON, t) ); \
106 } \
107 template<typename Functor, BOOST_PP_ENUM_PARAMS(n,typename AA)> \
108 auto call_fused( Functor f, const tuple<BOOST_PP_ENUM_PARAMS(n,AA)>& t ) \
109 -> decltype( f( BOOST_PP_ENUM( n, LIST_MEMBERS_ON, t) ) ) { \
110 return f( BOOST_PP_ENUM( n, LIST_MEMBERS_ON, t) ); \
111 } \
112 template<BOOST_PP_ENUM_PARAMS( n, typename AA)> \
113 struct is_tuple<fc::tuple<BOOST_PP_ENUM_PARAMS(n,AA)> > { \
114 typedef fc::true_type type; \
115 }; \
116 template<BOOST_PP_ENUM_PARAMS( n, typename AA)> \
117 struct deduce<fc::tuple<BOOST_PP_ENUM_PARAMS(n,AA)> > { \
118 typedef fc::tuple<BOOST_PP_ENUM( n, DEDUCE_MEMBERS,unused)> type; \
119 };

◆ VISIT_PARAMS

#define VISIT_PARAMS ( z,
n,
data )
Value:
v(BOOST_PP_CAT(a,n));

Definition at line 78 of file tuple.hpp.