Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
make_fused.hpp
Go to the documentation of this file.
1#pragma once
2#include <fc/tuple.hpp>
3#include <fc/function.hpp>
4
5namespace fc {
6 template<typename R>
7 std::function<R, fc::tuple<> > make_fused( const std::function<R>& f ) {
8 return [=]( fc::tuple<> ){ return f(); };
9 }
10 template<typename R,typename A>
11 std::function<R(fc::tuple<A>) > make_fused( const std::function<R(A)>& f ) {
12 return [f]( fc::tuple<A> t){ return f(t.a); };
13 }
14 template<typename R,typename A,typename B>
15 std::function<R(fc::tuple<A,B>) > make_fused( const std::function<R(A,B)>& f ) {
16 return [f]( fc::tuple<A,B> t){ return f(t.a,t.b); };
17 }
18 template<typename R,typename A,typename B,typename C>
19 std::function<R(fc::tuple<A,B,C>) > make_fused( const std::function<R(A,B,C)>& f ) {
20 return [f]( fc::tuple<A,B,C> t){ return f(t.a,t.b,t.c); };
21 }
22 template<typename R,typename A,typename B,typename C,typename D>
23 std::function<R(fc::tuple<A,B,C,D>) > make_fused( const std::function<R(A,B,C,D)>& f ) {
24 return [f]( fc::tuple<A,B,C> t){ return f(t.a,t.b,t.c,t.d); };
25 }
26}
#define D(var, file, col, who, lev,...)
Definition debug.h:44
namespace sysio::chain
Definition authority.cpp:3
std::function< R, fc::tuple<> > make_fused(const std::function< R > &f)
Definition make_fused.hpp:7
#define R