EDIT: std::pair , . , 9.5.1. : 12.1.5:
X, . inline public . :
20.2.2.2 , :
pair(const T1& x, const T2& y);
, .
, (Visual Studio 2008), , std::pair. std::pair foo, :)
namespace foo {
template<class _Ty1, class _Ty2> struct pair {
typedef _Ty1 first_type;
typedef _Ty2 second_type;
pair() : first(_Ty1()), second(_Ty2()) {
}
}
}
union Baz {
foo::pair<bool, double> a;
int b;
}
union Buz {
std::pair<bool, double> a;
int b;
}
. C (short for construct), , CMyClass(a, b).
, -. -, ( , , , ), f s , -, , , min(sizeof(s), sizeof(f)) , MyClass . bool a, :
int bool, - : true false.char bool. , , sizeof(int), , , 1. , MyClass , , - .
T, , , , - .