Jak przekazać funkcję szablonu na liście argumentów szablonu

Przypuśćmy, że mamtemplate funkcjonować:

template<typename T>
T produce_5_function() { return T(5); }

Jak mogę przekazać to całetemplate do innegotemplate?

Jeśliproduce_5_function był funktorem, nie byłoby problemu:

template<typename T>
struct produce_5_functor {
  T operator()() const { return T(5); }
};
template<template<typename T>class F>
struct client_template {
  int operator()() const { return F<int>()(); }
};
int five = client_template< produce_5_functor >()();

ale chcę to zrobić za pomocą szablonu funkcji surowej:

template<??? F>
struct client_template {
  int operator()() const { return F<int>(); }
};
int five = client_template< produce_5_function >()();

Podejrzewam, że odpowiedź brzmi „nie możesz tego zrobić”.

questionAnswers(2)

yourAnswerToTheQuestion