Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2000-07-23 19:35:30


Greg Colvin wrote on 7/23/2000 8:03 PM
>> > Or if we are feeling very brave, how about something like
>> > #define If whatever<
>> > #define Then ,
>> > #define Else ,
>> > #define End >::type
>> > so that instead of the inscrutable
>> > typedef If<flag, type1, type2>::type my_type;
>> > we can write
>> > typedef
>> > If flag Then
>> > type1
>> > Else
>> > type2
>> > End
>> > my_type;
>> >
>> > And Howard thought he was getting punchy!
>
>No comment, eh?

I like to:

#define program
#define HelloWorld int main()
#define begin {
#define end }
#define writeln(x) std::cout << x << '\n'

so I can write:

program HelloWorld

begin
  writeln("Hello World");
end

;-)

Syntax sugar can get sooo sticky!

-Howard


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk