C ++: Make VS2010 complain about "If" with "="
Is there any way in VS2010 C ++ to complain about the IDE if I do something like
if (somevar = 2)
{
...
?
I am trying to draw attention to not only writing == instead of =, but not only using C ++ but also VB and other languages, it happens sometimes.
It takes a long time to find errors related to my error.
I think the possibility that an if statement really wants to write that also assigns a new value to a variable (like in my example above) is pretty small. This is why I hope VS2010 might include an option that tells me about my possible flaw, but I haven't found one.
Is there such an option?
+3
source to share
2 answers