class A
{
public:
int x;
//create a vector of functors in B and C here
};
class B
{
public:
struct bFunctor
{
void operator()() const
{
//some code
}
};
};
class C
{
public:
struct cFunctor
{
void operator()() const
{
//some code
}
};
};
void main()
{
A obj;
//iterate through the vector in A and call the functors in B and C
}
我的问题是invector
类A
中调用and的格式应该是什么?或者这是唯一可能有一个基础并从中获得并从中派生的唯一方法?还是有更好的方法?functors
B
C
functor
A
functors
B
C