ternary conditional in c++