- #1
Pete5876
- 7
- 0
C++:
vector<OP> negate (vector<OP> a) {
a.insert(a.begin(), neg);
return a;
}
vector<vector<OP>> negate (vector<vector<OP>> a) {
for (int i=0; i<a.size(); i++)
a[i] = negate(a[i]); // reference to 'negate' is ambiguous?
return a;
}
OP is an enum here. Why can't C++ distinguish between these two? One function takes a two-dimensional vector of OP whereas the other one takes a three-dimensional vector of OP. I can't flatten that 3D vector because it's elements aren't of the same size.