#include <iostream>

//A functor to store the input functions and call them
template <typename LEFT, typename RIGHT>
struct combine_functions {
private:
  LEFT left;
  RIGHT right;
public:
  combine_functions(const LEFT &left, const RIGHT &right)
   : left(left), right(right) {}

  template <typename ...ARGS>
  auto operator()(ARGS&... args) const
  -> decltype(left(args...), static_cast<void>(right(args...)))
  {
    left(args...);
    right(args...);
  }

};

//I should probably have an enable if that checks the arguments 
//are function pointers or functors
template <typename LEFT, typename RIGHT>
combine_functions<
  std::decay_t<LEFT>,
  std::decay_t<RIGHT>
>
concat(
  const LEFT &left,
  const RIGHT &right
) {
  return {left, right};
}

int main()
{
    concat([](const auto& t) {std::cout << t;},
           [](const auto& t) {std::cerr << t;})
           ("Hello world");
}