The reason std::select1st
is not present by default is that it is not part of the C++ standard library. It is one of the parts of the Standard Template Library (STL) that was not adopted into the C++ standard.
I can't find any documentation on MSDN for _HAS_TRADITIONAL_STL
, and it doesn't appear to be used in the version of the standard library distributed with Visual Studio 2010. It is probably included in the library by Dinkumware when they deliver it to Microsoft.
That having been said, it is probably safe to define if you want to use std::select1st
. Just note that using anything enabled by that flag is implementation-specific and nonportable (and may even change between versions of Visual C++). You would probably be better off implementing your own select1st
function:
template <typename PairT>
struct select1st : public std::unary_function<PairT, typename PairT::first_type>
{
typename PairT::first_type operator()(const PairT& a) { return a.first; }
};