Is there any situation which can be handled by ternary operator but
not with if else blocks?
if-else requires assignability. Anything that doesn't support assignment
cannot be used with if-else. In addition to the already provided constructor
initialization list, three more that I can think of:
1) A class that doesn't define operator=:
Class UnAssignable{ /* ... */ };
/* copy construction */
UnAssignable object = condition ? first : second;
2) Initializing a reference:
Class & reference = condition ? first : second;
3) Initializing a constant:
SomeType const object = condition ? first : second;
Ali