Is there a C++ equivalent for C# null coalescing operator? I am doing too many null checks in my code. So was looking for a way to reduce the amount of null code.
I just found this: The ?? operator aka the Null Coalescing Operator
You also have it in C/C++ as a GNU extension using the ?: operator : string pageTitle = getTitle() ?: "Default Title";
You also have it in C/C++ as a GNU extension using the ?: operator :
?:
string pageTitle = getTitle() ?: "Default Title";