Today, while I was digging around on the web for some information on template meta-programming I ran across some really interesting code:

bool a1 = false;
bool a2 = false;
bool a3 = true;

std::cout << ( a1 ? "true" : a2 ? "a2=true" : a3 ? "a3=true" : "all=false" ) << std::endl;

 

Add to My Yahoo!

Add to Google

Subscribe with Bloglines

Austin Gilbert/Male/26-30. Lives in United States/Oklahoma/Tulsa/Midtown, speaks English. Spends 40% of daytime online. Uses a Fast (128k-512k) connection. And likes computer science/photography.
This is my blogchalk: United States, Oklahoma, Tulsa, Midtown, English, Austin Gilbert, Male, 26-30, computer science, photography.

C++ Tertiary Operator can be chained
2008/06/12