Eelis is a C++ programmer who writes about language tricks and maintains an HTML build of the C++ draft standard.
HN commenters repeatedly cite his multi-dimensional analog literals as one of the most magnificent abuses of C++ operator overloading, and link his standard draft.
Somehow I'm reminded of "Multi-Dimensional Analog Literals" project for C++:
assert( ( o-------------o
|L \
| L \
| L \
| o-------------o
| ! !
! ! !
o | !
L | !
L | !
L| !
o-------------o ).volume == ( o-------------o
| !
! !
! !
o-------------o ).area * int(I-------------I) );
http://www.eelis.net/C++/analogliterals.xhtml
Reminded me of http://www.eelis.net/C++/analogliterals.xhtml, which starts with
unsigned int a = 4;
unsigned int b = I---------I;
assert( a == b );
Moves on to 2D:
unsigned int c = ( o-----o
| !
! !
! !
o-----o ).area;
assert( c == (I-----I) * (I-------I) );
and puts the cherry on the cake with 3D literals:
assert( top( o-------o
|L \
| L \
| o-------o
| ! !
! ! !
o | !
L | !
L| !
o-------o ) == ( o-------o
| !
! !
o-------o ) );
Also, never forget, the C++ Multi-Dimensional Analog Literals:
assert( ( o-------------o
|L \
| L \
| L \
| o-------------o
| ! !
! ! !
o | !
L | !
L | !
L| !
o-------------o ).volume == ( o-------------o
| !
! !
! !
o-------------o ).area * int(I-------------I) );
http://www.eelis.net/C++/analogliterals.xhtml
<Eelis> i could implement a "geordi, fix my code" command, and
still most people would remember me for those cursed analog
literals.
geordi is an IRC C++ bot that Eelis made in Haskell. It parses and runs C++:
http://www.eelis.net/geordi/
Since it actually can parse C++, it can be given C++ editing commands, although you have to know the C++ grammar in order to give it those commands.
Eelis has also written the IRC bot geordi. The bot "evaluates" C++ snippets by compiling them with GCC (or clang), executing the resulting binary in a sandbox and pipes the output back to IRC. It's heavily used in C++ channels on multiple IRC networks.
http://www.eelis.net/geordi
We do not have yet three dimensional white space overloading unfortunately, will have to wait for the next release train, targeting C++26.
In the meantime, you can use multidimensional analog literals: http://www.eelis.net/C++/analogliterals.xhtml