24

A while ago I stumbled upon a C++ gem, a set of classes that through operator overloading and possibly some preprocessor tricks, let you define variables using in-code ASCII art:

Line x = |-----|;    //x is 5
Line y = |---|;      //y is 3

Rectangle r = +---+
              |   |
              +---+; //r is 3 by 1

and IIRC, it even had support for 3D figures!

But for the life of me I cannot remember the name of this library/header file/set of classes. What is it called?

Andrew Eisenberg
  • 28,387
  • 9
  • 92
  • 148
aib
  • 45,516
  • 10
  • 73
  • 79
  • 1
    I remember seeing it somewhere a while ago, but never looked into it. It looks hilarious! Nothing I'd ever use in developement though! :p – DeadHead May 20 '09 at 01:57
  • Based on your title I thought you were talking about figlets http://www.figlet.org/ – JensenDied May 20 '09 at 01:57
  • @Brian: It could have fooled me. Oh, wait. – aib May 20 '09 at 13:26
  • 1
    This kind of fun hijacking of the C++ syntax also leads to the much more serious boost::spirit. http://boost-spirit.com/home – Gabriel Nov 01 '11 at 15:45

1 Answers1

24

I believe you are after Multi-Dimensional Analog Literals

http://www.eelis.net/C++/analogliterals.xhtml

Waws
  • 203
  • 1
  • 2
  • 15
Matthew
  • 3,086
  • 2
  • 20
  • 9
  • Mirrored and expanded (with a less constrained syntax and support for 0-unit widths/lengths/heights) here: https://github.com/Quuxplusone/analog-literals – Quuxplusone Apr 04 '14 at 22:45