Apply a tuple of functions to a value and return a tuple <p>Right now, I have the following to apply two functions to a value and return a 2-value tuple:</p> <pre><code>template&lt;typename F1, typename F2&gt; class Apply2 { public: using return_type = std::tuple&lt;typename F1::return_type, typename F2::return_type&gt;; Apply2(const F1&amp; f1, const F2&amp; f2) : f1_(f1), f2_(f2) {} template&lt;typename T&gt; return_type operator()(const T&amp; t) const { return std::make_tuple(f1_(t), f2_(t)); } protected: const F1&amp; f1_; const F2&amp; f2_; }; </code></pre> <p>I wanted to generalize this to N functions:</p> <pre><code>template&lt;typename ...F&gt; class ApplyN { public: using return_type = std::tuple&lt;typename F::return_type...&gt;; ApplyN(const std::tuple&lt;F...&gt;&amp; fs) : functions_(fs) {} template&lt;typename T&gt; return_type operator()(const T&amp; t) const { return ???; } protected: std::tuple&lt;F...&gt; functions_; }; </code></pre> <p>I know I probably need to use template recursion somehow, but I can't wrap my head around it. Any ideas?</p>