M
mark.van.dijk
Hi there, the C++ standard (section 20.2) defines std::make_pair() as:
template <class T1, class T2>
pair<T1, T2> make_pair(const T1& x, const T2& y);
On my system (.NET 2003) it is defined as:
template<class _Ty1, class _Ty2> inline
pair<_Ty1, _Ty2> __cdecl make_pair(_Ty1 _Val1, _Ty2 _Val2)
{
// return pair composed from arguments
return (pair<_Ty1, _Ty2>(_Val1, _Val2));
}
In particular, not that the arguments _Val1 and _Val2 are passed in by
value, and not by reference.
Is this a bug in the .NET library? or is this actually allowed by the
spec?
template <class T1, class T2>
pair<T1, T2> make_pair(const T1& x, const T2& y);
On my system (.NET 2003) it is defined as:
template<class _Ty1, class _Ty2> inline
pair<_Ty1, _Ty2> __cdecl make_pair(_Ty1 _Val1, _Ty2 _Val2)
{
// return pair composed from arguments
return (pair<_Ty1, _Ty2>(_Val1, _Val2));
}
In particular, not that the arguments _Val1 and _Val2 are passed in by
value, and not by reference.
Is this a bug in the .NET library? or is this actually allowed by the
spec?