This is the landing page for a series of 7 posts around the naughty little snippet of C++ shown below:
/* This is valid C++ */
auto main() -> decltype('O.o') try
<%[O_O = 0b0]<%
https://gha.st/a-tour-of-rare-cpp-features/
typedef struct o O;
o*(*((&&o(o*o))<:'o':>))(o*o);
if(O*O = decltype(0'0[o(0)](0))(0)) 1,000.00;
else return 0==O==0 ? throw O_O : O_O;
%>();%>
catch(...) { throw; }
Links to the individual posts:
Part 1: Introduction and trailing return types, decltype
and multicharacter literals
Part 2: Function try blocks, catch-all exception handlers and rethrowing exceptions
Part 3: Digraphs, trigraphs and lambda functions
Part 4: Generalized lambda captures, binary literals and URLs
Part 5: The function declaration from hell
Part 6: Declaring Variables in if Statements, function style casts and digit grouping
Part 7: The comma and ternary operators
And just to ward of any possible complaints: You should never write code like this. That being said, am aware that this code does generate warnings when compiled, nevertheless it should be correct and run without error.