I am currently porting some Unix code to Windows and came across a rather strange use of the conditional operator which is not valid syntax according to Visual Studio (either 2010 or 2012).
Copied and pasted without modification:
filename = filename ? : h->filename;
There is no condition! I assume it is either a check against an empty string (of the const char*
sort), or against null & empty, as I can't think of anything else it can be.
Has anybody seen this before? Thank you.