I found this weird code on the net but can't figure out what it does. When I compile it I don't get any output.
int main()<%auto f = <::><%%>;%>
I found this weird code on the net but can't figure out what it does. When I compile it I don't get any output.
int main()<%auto f = <::><%%>;%>
Using digraphs, <%
corresponds to {
, and %>
corresponds to }
.
Substituting these in yields
int main(){ auto f = <::>{}; }
Finally, <:
is equivalent to [
and :>
to ]
, so we end up with
int main(){ auto f = []{}; }
where []{}
is an empty lambda, and f
is a copy of the closure object.
It uses digraphs to obfuscate some simple code. It is exactly the same as
int main() { auto f = []{}; }
In other words, not much. It just instantiates an empty lambda, binding it to f
. f
isn't even called.