Программы на C++. Форум разработчиков
-
Anonymous
Как передать аргументы функции шаблона?
Сообщение
Anonymous »
При выполнении этого фрагмента кода:
Код: Выделить всё
#include
#include
#include
#include
template
struct FunctionWrapper;
template
struct FunctionWrapper {
using FuncType = std::function;
};
template
using FunctionType = typename FunctionWrapper::FuncType;
template
struct FunctionTypeWrapper {
std::function func;
template
FunctionTypeWrapper(Func&& f) : func(std::forward(f)) {}
bool operator
Подробнее здесь: [url]https://stackoverflow.com/questions/78351407/how-do-i-pass-arguments-to-a-template-function[/url]
1713506660
Anonymous
При выполнении этого фрагмента кода:
[code]#include
#include
#include
#include
template
struct FunctionWrapper;
template
struct FunctionWrapper {
using FuncType = std::function;
};
template
using FunctionType = typename FunctionWrapper::FuncType;
template
struct FunctionTypeWrapper {
std::function func;
template
FunctionTypeWrapper(Func&& f) : func(std::forward(f)) {}
bool operator
Подробнее здесь: [url]https://stackoverflow.com/questions/78351407/how-do-i-pass-arguments-to-a-template-function[/url]