Long time ago (10+ years) I saw a syntax which let you declare array with "ascii art".
Something like this:
//Declares 5x3 2d array
int myArray[] = #####
# #
#####
It was even possible to draw a cuboid for 3d arrrays.
My primary language for a very long time is a C++, so I'm sure it was C/C++. My memory tells my that I read about it in some "C++ deprecated features" article, but I doubt this was ever in standard. Maybe it was some kind of a language extension.
It seems that I'm unable to come up with correct words to google it and it bothers me a lot :)
Does anybody has any idea is whether such syntax ever existed in some form?
Sounds very much like Eelis' Multi-Dimensional Analog Literals (also linked here). Short example:
#include <cassert>
#include "analogliterals.hpp"
using namespace analog_literals::symbols;
int main()
{
auto l = I---------I;
auto r = o---------o
| !
! !
o---------o;
assert(l.length == 4);
assert(r.width == 4 && r.height == 2);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With