I have a method in class which returns bool. This bool signifies if the call was successful or or not. Many a time users of this method misses to capture the bool
bool bar()
{
return true; //or false in some cases
}
bool result = bar(); //
bar();// Can we get a warning or compiler error here
This is similar to Force function to return value and make compile error C# But the answers there are not applicable here.
I am using gcc 4.4.7