// // named_pair.h // stream // // Created by Sam Jaffe on 3/30/23. // #pragma once #ifndef CONCAT #define CONCAT2(A, B) A##B #define CONCAT(A, B) CONCAT2(A, B) #endif #define NAMED_PAIR_CLASS_NAME(first, second) \ CONCAT(CONCAT(CONCAT(first, _), second), _result) #define NAMED_PAIR(l, r) \ template struct NAMED_PAIR_CLASS_NAME(l, r) { \ NAMED_PAIR_CLASS_NAME(l, r)(L l, R r) : l(l), r(r) {} \ L l; \ R r; \ } namespace stream::detail { NAMED_PAIR(in, fun); NAMED_PAIR(min, max); }