A Different kind of Visual(ish) C++!
unsigned int b = I---------I;
unsigned int a = 4;
assert( a == b ) ;
The assert is there just to prove that b is really 4. The number of dashes between two two I's is 9. Due to the way C++ operators work, the number of dashes must be = 2*n + 1. If you think that's odd, what about 2 dimensions? These one-dimensional analog literals are of type
analog_literals::line
Moving into two dimensions...
I can't see myself ever making use of Analog Literals but if you want to try something a bit "out there"!
analog_literals::rectangle<X, Y>
unsigned int c = ( o-----o
|
!
!
o-----o ).area;


No comments yet. Leave a Comment