我正在尝试这样做。C++ 11。如何从没有const的元组中获取元素
int flag = 0;
if(big.size() <= small.size())
flag = 1; //use float
tuple<long, float> tup (1234.5678, 12341234.1234);
auto foo = get<flag>(tup);
但我得到的错误:
error: the value of 'flag' is not usable in a constant expression
cout << get<flag>(tup);
- 和 -
note: 'int flag' is not const
int flag = 0;
我的问题是玛丽有只小羊羔到指环王 – djent