suggest parentheses around comparison in operand of &|

Posted happyamyhope

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了suggest parentheses around comparison in operand of &|相关的知识,希望对你有一定的参考价值。

error discription:

.cpp:187:25: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
         if (data_cur[j] == 255 & data_pre[j] == 255) temp.at<uchar>(i, j) = 255
                

why:

该警告希望你在&(逻辑与)表达式左右加上括号。有的时候&&(逻辑且)少写了一个&,也会产生该警告。

因为&运算符的优先级较低,低于==和!=运算符。

if ( (data_cur[j] == 255) && (data_pre[j] == 255) ) temp.at<uchar>(i, j) = 255;

RE

1.cnblogs-here;

End

以上是关于suggest parentheses around comparison in operand of &|的主要内容,如果未能解决你的问题,请参考以下文章

返回suggester的类型(Returning the type of the suggester)

建议者(Suggesters)

Solrj 与 Solr Suggester

iBase4j前端01_bootstrap-suggest json-server模拟后台数据bootstrap-suggest环境搭建开启bootstrap-suggest的post和put请(代

Suggestion(搜索建议)产品和技术

LeetCode 1268. Search Suggestions System