I think before we answer properlly we need to know what you are trying to accomplish by the if(v) statement.
I assume that you want to know if a and b members have been assigned values? If this is the case then you'll need to initialize the members to a value that the user won't enter (if possible, otherwise you'll need other members to denote that the member has been entered) and test those members against the unassigned value in the if statement as follows:
The expression within the '(' and ')' parenthesis in an 'if' statement will be evaluated as 'test context'.
In a 'test context' the value of expression causes to flow in one or other way depending on the computed value if zero or non-zero. You can write any expression that has a 'scalar rvalue' result, because scalar types can only be compared with zero. However there can be 'side-effects' when evaluating an expression. Care should be taken about those.