mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-04 07:14:30 +02:00
Workaround for VC7.0 ETI bug.
[SVN r21159]
This commit is contained in:
@@ -17,12 +17,15 @@
|
|||||||
#ifndef BOOST_MPL_AUX_SELECT1ST_WKND_HPP_INCLUDED
|
#ifndef BOOST_MPL_AUX_SELECT1ST_WKND_HPP_INCLUDED
|
||||||
#define BOOST_MPL_AUX_SELECT1ST_WKND_HPP_INCLUDED
|
#define BOOST_MPL_AUX_SELECT1ST_WKND_HPP_INCLUDED
|
||||||
|
|
||||||
|
#include "boost/mpl/aux_/is_msvc_eti_arg.hpp"
|
||||||
#include "boost/mpl/aux_/config/eti.hpp"
|
#include "boost/mpl/aux_/config/eti.hpp"
|
||||||
|
|
||||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||||
|
|
||||||
namespace boost { namespace mpl { namespace aux {
|
namespace boost { namespace mpl { namespace aux {
|
||||||
|
|
||||||
|
# if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||||
|
|
||||||
template< typename Pair >
|
template< typename Pair >
|
||||||
struct select1st_wknd
|
struct select1st_wknd
|
||||||
{
|
{
|
||||||
@@ -34,14 +37,40 @@ template<> struct select1st_wknd<int>
|
|||||||
typedef int type;
|
typedef int type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# else // !defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||||
|
|
||||||
|
template< bool > struct select1st_wknd_impl
|
||||||
|
{
|
||||||
|
template< typename Pair > struct result_
|
||||||
|
{
|
||||||
|
typedef typename Pair::second type;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
template<> struct select1st_wknd_impl<false>
|
||||||
|
{
|
||||||
|
template< typename Pair > struct result_
|
||||||
|
{
|
||||||
|
typedef int type;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
template< typename Pair > struct select1st_wknd
|
||||||
|
: select1st_wknd_impl< !aux::is_msvc_eti_arg<Pair>::value >
|
||||||
|
::template result_<Pair>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
# endif // BOOST_MPL_MSVC_60_ETI_BUG workaround
|
||||||
|
|
||||||
}}} // namespace boost::mpl::aux
|
}}} // namespace boost::mpl::aux
|
||||||
|
|
||||||
# define BOOST_MPL_AUX_SELECT1ST_WKND(pair) ::boost::mpl::aux::select1st_wknd< pair >::type
|
# define BOOST_MPL_AUX_SELECT1ST_WKND(pair) ::boost::mpl::aux::select1st_wknd< pair >::type
|
||||||
|
|
||||||
#else
|
#else // !defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||||
|
|
||||||
# define BOOST_MPL_AUX_SELECT1ST_WKND(pair) pair::first
|
# define BOOST_MPL_AUX_SELECT1ST_WKND(pair) pair::first
|
||||||
|
|
||||||
#endif
|
#endif // BOOST_MPL_MSVC_ETI_BUG workaround
|
||||||
|
|
||||||
#endif // BOOST_MPL_AUX_SELECT1ST_WKND_HPP_INCLUDED
|
#endif // BOOST_MPL_AUX_SELECT1ST_WKND_HPP_INCLUDED
|
||||||
|
@@ -17,12 +17,15 @@
|
|||||||
#ifndef BOOST_MPL_AUX_SELECT2ND_WKND_HPP_INCLUDED
|
#ifndef BOOST_MPL_AUX_SELECT2ND_WKND_HPP_INCLUDED
|
||||||
#define BOOST_MPL_AUX_SELECT2ND_WKND_HPP_INCLUDED
|
#define BOOST_MPL_AUX_SELECT2ND_WKND_HPP_INCLUDED
|
||||||
|
|
||||||
|
#include "boost/mpl/aux_/is_msvc_eti_arg.hpp"
|
||||||
#include "boost/mpl/aux_/config/eti.hpp"
|
#include "boost/mpl/aux_/config/eti.hpp"
|
||||||
|
|
||||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||||
|
|
||||||
namespace boost { namespace mpl { namespace aux {
|
namespace boost { namespace mpl { namespace aux {
|
||||||
|
|
||||||
|
# if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||||
|
|
||||||
template< typename Pair >
|
template< typename Pair >
|
||||||
struct select2nd_wknd
|
struct select2nd_wknd
|
||||||
{
|
{
|
||||||
@@ -34,14 +37,40 @@ template<> struct select2nd_wknd<int>
|
|||||||
typedef int type;
|
typedef int type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# else // !defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||||
|
|
||||||
|
template< bool > struct select2nd_wknd_impl
|
||||||
|
{
|
||||||
|
template< typename Pair > struct result_
|
||||||
|
{
|
||||||
|
typedef typename Pair::second type;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
template<> struct select2nd_wknd_impl<false>
|
||||||
|
{
|
||||||
|
template< typename Pair > struct result_
|
||||||
|
{
|
||||||
|
typedef int type;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
template< typename Pair > struct select2nd_wknd
|
||||||
|
: select2nd_wknd_impl< !aux::is_msvc_eti_arg<Pair>::value >
|
||||||
|
::template result_<Pair>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
# endif // BOOST_MPL_MSVC_60_ETI_BUG workaround
|
||||||
|
|
||||||
}}} // namespace boost::mpl::aux
|
}}} // namespace boost::mpl::aux
|
||||||
|
|
||||||
# define BOOST_MPL_AUX_SELECT2ND_WKND(pair) ::boost::mpl::aux::select2nd_wknd< pair >::type
|
# define BOOST_MPL_AUX_SELECT2ND_WKND(pair) ::boost::mpl::aux::select2nd_wknd< pair >::type
|
||||||
|
|
||||||
#else
|
#else // !defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||||
|
|
||||||
# define BOOST_MPL_AUX_SELECT2ND_WKND(pair) pair::second
|
# define BOOST_MPL_AUX_SELECT2ND_WKND(pair) pair::second
|
||||||
|
|
||||||
#endif
|
#endif // BOOST_MPL_MSVC_ETI_BUG workaround
|
||||||
|
|
||||||
#endif // BOOST_MPL_AUX_SELECT2ND_WKND_HPP_INCLUDED
|
#endif // BOOST_MPL_AUX_SELECT2ND_WKND_HPP_INCLUDED
|
||||||
|
Reference in New Issue
Block a user