我们如何知道boost变体中存在哪些容器数据?我的变体有任何数据类型或容器。如何访问容器中的数据类型?boost::variant<string, int> myvar = 245; std::cout<<"integer datatype"<< '\n';//I am able to get the type of integer/string
b
我看到了一些关于避免RTTI的问题,但我的问题似乎更具体一些。下面是一个例子:struct B : Base {};我想对向量中所有可能的(无序的)对象(如果向量有3个元素,包含0和1,0和2,1和2)做一些事情。我想要的伪代码是这样的: behavior1(e1, e2) behavior2(e1,