由值对进行 pair 。
template<typename Value1,
typename Value2>
pair<Value1, Value2> make_pair(Value1 first, Value2 second);
参数
Value1
第一个包装值的类型。Value2
第二个包装值的类型。首先
包装的第一个值。接下来
包装的第二个值。
备注
模板函数返回 pair_AMP_lt_Value1,Value2_AMP_gt_(first,second)。使用该构造从值对的一 pair_AMP_lt_Value1,Value2_AMP_gt_ 对象。
示例
// cliext_make_pair.cpp
// compile with: /clr
#include <cliext/utility>
int main()
{
cliext::pair<wchar_t, int> c1(L'x', 3);
System::Console::WriteLine("[{0}, {1}]", c1.first, c1.second);
c1 = cliext::make_pair(L'y', 4);
System::Console::WriteLine("[{0}, {1}]", c1.first, c1.second);
return (0);
}
要求
标题: <cliext/实用工具>
命名空间: cliext