Wire Sysio Wire Sysion 1.0.0
|
#include <tuple.hpp>
Provides a fast-compiling tuple that doesn't use fancy meta-programming techniques. It is limited to 4 parameters which is sufficient for most methods argument lists which is the primary use case for this tuple. Methods that require more than 4 parameters are probably better served by defining a struct. The members of the tuple are easily visited with a simple visitor functor of the form: @code struct visitor { template<typename MemberType> void operator()( MemberType& m ); template<typename MemberType> void operator()( const MemberType& m ); }; @endcode
template<typename A=void, typename B=void,typename C=void, typename D=void>> struct tuple { tuple(){} enum size_enum { size = 4 };
template<typename AA, typename BB, typename CC, typename DD> tuple( AA&& aa, BB&& bb, CC&& cc, DD&& dd ) :a( fc::forward<AA>(aa) ), b( fc::forward<BB>(bb) ), c( fc::forward<CC>(cc) ), d( fc::forward<DD>(dd) ) {}
template<typename V> void visit( V&& v ) { v(a); v(b); v(c); v(d); } template<typename V> void visit( V&& v )const { v(a); v(b); v(c); v(d); }