I’m getting the following error:
`.' cannot appear in a constant-expression
for this function (line 4):
bool Covers(const Region<C,V,D>& other) const {
const Region& me = *this;
for (unsigned d = 0; d < D; d++) {
if (me[d].min > other[d].min || me[d].max < other[d].max) {
return false;
}
}
can anyone explain the problem please?
EDIT:
the definition of Region is:
template <typename C, typename V, unsigned D>
class Region : public boost::array<Detail::Range<C>,D>
when Range has a min and max variables.
Trying out your code tells me, that the compiler has a problem with the
me[d].max < other[d].maxpart. So the problem with the dot was bogus. Instead the compiler has a problem with the comparison operator. Just reverting the comparison made the compiler error magically disappear: