more Borland fixes

[SVN r25964]
This commit is contained in:
Aleksey Gurtovoy
2004-10-30 08:22:23 +00:00
parent 1f249a29bd
commit ab0da77c2e
4 changed files with 45 additions and 18 deletions

View File

@@ -60,7 +60,7 @@ struct has_rebind
#else // the rest
template< typename T > struct has_rebind_tag {};
yes_tag operator|(has_rebind_tag<int>, void const volatile*);
no_tag operator|(has_rebind_tag<int>, void const volatile*);
# if !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
template< typename T >
@@ -68,7 +68,7 @@ struct has_rebind
{
static has_rebind_tag<T>* get();
BOOST_STATIC_CONSTANT(bool, value =
sizeof(has_rebind_tag<int>() | get()) == sizeof(char)
sizeof(has_rebind_tag<int>() | get()) == sizeof(yes_tag)
);
};
# else // __BORLANDC__
@@ -77,7 +77,7 @@ struct has_rebind_impl
{
static T* get();
BOOST_STATIC_CONSTANT(bool, value =
sizeof(has_rebind_tag<int>() | get()) == sizeof(char)
sizeof(has_rebind_tag<int>() | get()) == sizeof(yes_tag)
);
};

View File

@@ -24,9 +24,13 @@
#else
# include <boost/mpl/int_fwd.hpp>
# include <boost/mpl/aux_/yes_no.hpp>
# include <boost/mpl/aux_/na_fwd.hpp>
# include <boost/mpl/aux_/preprocessor/params.hpp>
# include <boost/mpl/aux_/preprocessor/enum.hpp>
# include <boost/mpl/aux_/config/msvc.hpp>
# include <boost/mpl/aux_/config/workaround.hpp>
# include <boost/preprocessor/tuple/to_list.hpp>
# include <boost/preprocessor/list/for_each_i.hpp>
# include <boost/preprocessor/inc.hpp>
@@ -109,15 +113,19 @@ template< typename T > struct has_rebind_tag;
#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
# define BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) \
template< BOOST_MPL_PP_PARAMS(i,typename T) > \
char operator|( \
::boost::mpl::aux::yes_tag operator|( \
::boost::mpl::aux::has_rebind_tag<int> \
, name<BOOST_MPL_PP_PARAMS(i,T)>* \
); \
::boost::mpl::aux::no_tag operator|( \
::boost::mpl::aux::has_rebind_tag<int> \
, name< BOOST_MPL_PP_ENUM(i,::boost::mpl::na) >* \
); \
/**/
#elif !BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
# define BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) \
template< BOOST_MPL_PP_PARAMS(i,typename T) > \
char operator|( \
::boost::mpl::aux::yes_tag operator|( \
::boost::mpl::aux::has_rebind_tag<int> \
, ::boost::mpl::aux::has_rebind_tag< name<BOOST_MPL_PP_PARAMS(i,T)> >* \
); \

View File

@@ -15,22 +15,10 @@
// $Revision$
#include <boost/mpl/bool.hpp>
#include <boost/mpl/aux_/adl_barrier.hpp>
#include <boost/mpl/aux_/na_fwd.hpp>
#include <boost/mpl/aux_/config/msvc.hpp>
#include <boost/mpl/aux_/config/ctps.hpp>
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
// n.a. == not available
struct na
{
typedef na type;
enum { value = 0 };
};
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
BOOST_MPL_AUX_ADL_BARRIER_DECL(na)
namespace boost { namespace mpl {
template< typename T >

View File

@@ -0,0 +1,31 @@
#ifndef BOOST_MPL_AUX_NA_FWD_HPP_INCLUDED
#define BOOST_MPL_AUX_NA_FWD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2001-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Source$
// $Date$
// $Revision$
#include <boost/mpl/aux_/adl_barrier.hpp>
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
// n.a. == not available
struct na
{
typedef na type;
enum { value = 0 };
};
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
BOOST_MPL_AUX_ADL_BARRIER_DECL(na)
#endif // BOOST_MPL_AUX_NA_FWD_HPP_INCLUDED