1#ifndef AMPGEN_LITESPAN_H
2#define AMPGEN_LITESPAN_H
8 template <
typename return_type,
typename ...arg_types>
struct KeyedFunctors;
10 template <
typename return_type,
typename ...arg_types>
struct KeyedFunctors <return_type(arg_types...)>
12 std::vector<std::function<return_type(arg_types...)> >
functors;
13 std::vector<std::string>
keys;
15 template <
typename functor_type>
void add(
const functor_type& functor,
const std::string& key,
const std::string& title=
"")
21 std::vector<return_type>
operator()( arg_types... arg )
const
23 std::vector<return_type> rt;
24 for(
auto& f :
functors ) rt.push_back( f(arg...) );
std::vector< std::function< return_type(arg_types...)> > functors
std::vector< return_type > operator()(arg_types... arg) const
std::vector< std::string > titles
void add(const functor_type &functor, const std::string &key, const std::string &title="")
std::vector< std::string > keys