Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
タプルがあるとしましょう:
#define T (a, b)
外部ライブラリを使用せずに、gccでタプルの最初と2番目の要素を抽出するにはどうすればよいですか?
私はこれを行う1つの方法を見つけました。これが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 to a second(T) // expands to b