Я пытаюсь шаблонизировать класс
template <typename OperationT, typename OperationCommandT>
struct OperationLink {
OperationT operationT;
OperationCommandT operationCommandT;
bool isEnabled;
// Param param;
};
, который я хочу использовать в классе отображения:
template <typename OperationLinkT>
class OperationList
{
public:
OperationList(){};
std::unordered_map<Operation, OperationLinkT> operationListTable
{
{Operation::NOOP, {std::shared_ptr<Noop> noop, std::shared_ptr<NoopCommand> noopCommand, true}},
{Operation::ERRORCHECK, {std::shared_ptr<Errorcheck> errorcheck, std::shared_ptr<ErrorcheckCommand> errorcheckCommand, true}},
{Operation::BASEINFO, {std::shared_ptr<Baseinfo> baseinfo, std::shared_ptr<BaseinfoCommand> baseinfoCommand, true}},
, но я делаю некоторую ошибку в списке инициализацииконструкция ... Я получаю error: expected '(' for function-style cast or type construction
Кто-то знает, что я делаю неправильно?
РЕДАКТИРОВАТЬ: правильно, забыл добавить:
// Operation: do nothing
class Noop : public Workflow
{
public:
Noop(std::shared_ptr<Context> context) : Workflow(context) {};
bool init();
bool execute();
};
// Operation: print a banner, together with get the c++ program info
class Baseinfo : public Workflow
{
public:
Baseinfo(std::shared_ptr<Context> context) : Workflow(context) {};
bool init();
bool execute();
};
классы для шаблонизации ... конечно они имеют одинаковую структуру