c preprocessor - Simple tuple operation -


say have tuple:

#define t (a, b) 

how can extract first , second element of tuple in gcc, without use of external libraries?

i found 1 way of doing this. i'm not sure if work in else gcc.

#define first_(x, y) x #define first(t) first_ t  #define second_(x, y) y #define second(t) second_ t  #define t (a, b)  first(t) // expands second(t) // expands b 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -