mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-03 06:44:37 +02:00
Initial release.
[SVN r20797]
This commit is contained in:
47
include/boost/mpl/aux_/select1st_wknd.hpp
Normal file
47
include/boost/mpl/aux_/select1st_wknd.hpp
Normal file
@@ -0,0 +1,47 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// boost mpl/aux_/select1st_wknd.hpp header file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2003
|
||||
// Eric Friedman, Aleksey Gurtovoy
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both the copyright notice and this permission notice appear in
|
||||
// supporting documentation. No representations are made about the
|
||||
// suitability of this software for any purpose. It is provided "as is"
|
||||
// without express or implied warranty.
|
||||
|
||||
#ifndef BOOST_MPL_AUX_SELECT1ST_WKND_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX_SELECT1ST_WKND_HPP_INCLUDED
|
||||
|
||||
#include "boost/mpl/aux_/config/eti.hpp"
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
|
||||
namespace boost { namespace mpl { namespace aux {
|
||||
|
||||
template< typename Pair >
|
||||
struct select1st_wknd
|
||||
{
|
||||
typedef typename Pair::first type;
|
||||
};
|
||||
|
||||
template<> struct select1st_wknd<int>
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
|
||||
}}} // namespace boost::mpl::aux
|
||||
|
||||
# define BOOST_MPL_AUX_SELECT1ST_WKND(pair) ::boost::mpl::aux::select1st_wknd< pair >::type
|
||||
|
||||
#else
|
||||
|
||||
# define BOOST_MPL_AUX_SELECT1ST_WKND(pair) pair::first
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_MPL_AUX_SELECT1ST_WKND_HPP_INCLUDED
|
47
include/boost/mpl/aux_/select2nd_wknd.hpp
Normal file
47
include/boost/mpl/aux_/select2nd_wknd.hpp
Normal file
@@ -0,0 +1,47 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// boost mpl/aux_/select2nd_wknd.hpp header file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2003
|
||||
// Eric Friedman, Aleksey Gurtovoy
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both the copyright notice and this permission notice appear in
|
||||
// supporting documentation. No representations are made about the
|
||||
// suitability of this software for any purpose. It is provided "as is"
|
||||
// without express or implied warranty.
|
||||
|
||||
#ifndef BOOST_MPL_AUX_SELECT2ND_WKND_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX_SELECT2ND_WKND_HPP_INCLUDED
|
||||
|
||||
#include "boost/mpl/aux_/config/eti.hpp"
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
|
||||
namespace boost { namespace mpl { namespace aux {
|
||||
|
||||
template< typename Pair >
|
||||
struct select2nd_wknd
|
||||
{
|
||||
typedef typename Pair::second type;
|
||||
};
|
||||
|
||||
template<> struct select2nd_wknd<int>
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
|
||||
}}} // namespace boost::mpl::aux
|
||||
|
||||
# define BOOST_MPL_AUX_SELECT2ND_WKND(pair) ::boost::mpl::aux::select2nd_wknd< pair >::type
|
||||
|
||||
#else
|
||||
|
||||
# define BOOST_MPL_AUX_SELECT2ND_WKND(pair) pair::second
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_MPL_AUX_SELECT2ND_WKND_HPP_INCLUDED
|
Reference in New Issue
Block a user