struct
bool
int
1234567891011121314151617181920
struct compound { bool b; int i; }; compound foo(int x, bool u) { compound result; result.b = u; result.i = x; return result; } int main() { compound a = foo(5, true); if(a.b) std::cout << a.i; }
123
std::pair<int, bool> x = std::make_pair(5, true); if(x.second) std::cout << x.first;