boost multiarray迭代器中缺少箭头运算符吗?我期望它能正常工作,这个想法有问题吗?
#include <vector>
#include <boost/multi_array.hpp>
struct foo {
int n;
};
int main()
{
{
std::vector<foo> a;
auto it = a.begin();
int test = it->n; // this does compile
}
{
boost::multi_array<foo, 1> a;
auto it = a.begin();
int test = it->n; // this does not compile
}
return 0;
}
'->': 指向引用的指针是非法的
。 - cambunctious