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

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

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -