小编Rab*_*bah的帖子

Is there a way to define a template member in a non-template class?

Say I have a class template named Compute, and another class named Function_A with a member function template:

template <typename T> void Evaluate(T parameter)
Run Code Online (Sandbox Code Playgroud)

I am constrained to use the class Function_A as it is. I already know that T can only be one of two types type_1 and type_2.

Is there a way to have something similar to Compute<T> C as a member variable of Function_A instead of defining a local Compute<T> object inside Evaluate(...)? I …

c++ templates class

8
推荐指数
1
解决办法
495
查看次数

标签 统计

c++ ×1

class ×1

templates ×1