`.' cannot appear in a constant-expression

后端 未结 4 1082
悲哀的现实
悲哀的现实 2021-01-21 23:56

I\'m getting the following error:

`.\' cannot appear in a constant-expression

for this function (line 4):

    bool Covers(const         


        
4条回答
  •  轮回少年
    2021-01-22 00:25

    Trying out your code tells me, that the compiler has a problem with the me[d].max < other[d].max part. 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:

    if (me[i].min > other[i].min || other[i].max > me[i].max) {
           return false;
    }
    

提交回复
热议问题