From 81f7e4bb992884a7c71d16b25729532075488af9 Mon Sep 17 00:00:00 2001 From: Aleksey Gurtovoy Date: Tue, 28 Sep 2004 13:56:59 +0000 Subject: [PATCH] ADL fixes [SVN r25453] --- include/boost/mpl/arg_fwd.hpp | 1 - include/boost/mpl/assert.hpp | 12 ++++++------ include/boost/mpl/aux_/adl_barrier.hpp | 21 ++++++--------------- include/boost/mpl/aux_/msvc_eti_base.hpp | 4 ++-- include/boost/mpl/aux_/msvc_is_class.hpp | 10 ++-------- include/boost/mpl/aux_/na.hpp | 8 ++++++-- include/boost/mpl/aux_/na_assert.hpp | 4 ++-- include/boost/mpl/aux_/nested_type_wknd.hpp | 9 +++------ include/boost/mpl/aux_/type_wrapper.hpp | 9 ++------- include/boost/mpl/aux_/value_wknd.hpp | 9 +++------ include/boost/mpl/aux_/yes_no.hpp | 8 ++------ include/boost/mpl/integral_c_fwd.hpp | 1 + include/boost/mpl/integral_c_tag.hpp | 1 + include/boost/mpl/long_fwd.hpp | 1 + 14 files changed, 37 insertions(+), 61 deletions(-) diff --git a/include/boost/mpl/arg_fwd.hpp b/include/boost/mpl/arg_fwd.hpp index 376d0b7..0fd8a88 100644 --- a/include/boost/mpl/arg_fwd.hpp +++ b/include/boost/mpl/arg_fwd.hpp @@ -23,7 +23,6 @@ BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN template< BOOST_MPL_AUX_NTTP_DECL(int, N) > struct arg; BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE - BOOST_MPL_AUX_ADL_BARRIER_DECL(arg) #endif // BOOST_MPL_ARG_FWD_HPP_INCLUDED diff --git a/include/boost/mpl/assert.hpp b/include/boost/mpl/assert.hpp index 68540e2..c7322e5 100644 --- a/include/boost/mpl/assert.hpp +++ b/include/boost/mpl/assert.hpp @@ -103,12 +103,12 @@ struct assert_relation {}; #else // BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES -aux::weighted_tag<1>::type operator==( assert_, assert_ ); -aux::weighted_tag<2>::type operator!=( assert_, assert_ ); -aux::weighted_tag<3>::type operator>( assert_, assert_ ); -aux::weighted_tag<4>::type operator>=( assert_, assert_ ); -aux::weighted_tag<5>::type operator<( assert_, assert_ ); -aux::weighted_tag<6>::type operator<=( assert_, assert_ ); +boost::mpl::aux::weighted_tag<1>::type operator==( assert_, assert_ ); +boost::mpl::aux::weighted_tag<2>::type operator!=( assert_, assert_ ); +boost::mpl::aux::weighted_tag<3>::type operator>( assert_, assert_ ); +boost::mpl::aux::weighted_tag<4>::type operator>=( assert_, assert_ ); +boost::mpl::aux::weighted_tag<5>::type operator<( assert_, assert_ ); +boost::mpl::aux::weighted_tag<6>::type operator<=( assert_, assert_ ); template< assert_::relations r, long x, long y > struct assert_relation {}; diff --git a/include/boost/mpl/aux_/adl_barrier.hpp b/include/boost/mpl/aux_/adl_barrier.hpp index 7bf8e09..2b98d15 100644 --- a/include/boost/mpl/aux_/adl_barrier.hpp +++ b/include/boost/mpl/aux_/adl_barrier.hpp @@ -23,6 +23,11 @@ # define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE mpl_ # define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN namespace mpl_ { # define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE } +# define BOOST_MPL_AUX_ADL_BARRIER_DECL(type) \ + namespace boost { namespace mpl { \ + using ::BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::type; \ + } } \ +/**/ #if !defined(BOOST_MPL_PREPROCESSING_MODE) namespace BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE { namespace aux {} } @@ -36,22 +41,8 @@ namespace aux { using namespace BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::aux; } # define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE boost::mpl # define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN namespace boost { namespace mpl { # define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE }} - -#endif - - -#if BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, <= 0x0295) \ - && !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) - -# define BOOST_MPL_AUX_ADL_BARRIER_DECL(type) \ - namespace boost { namespace mpl { \ - using ::BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::type; \ - } } \ -/**/ - -#else # define BOOST_MPL_AUX_ADL_BARRIER_DECL(type) /**/ -#endif +#endif #endif // BOOST_MPL_AUX_ADL_BARRIER_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/msvc_eti_base.hpp b/include/boost/mpl/aux_/msvc_eti_base.hpp index e694ad8..5b38856 100644 --- a/include/boost/mpl/aux_/msvc_eti_base.hpp +++ b/include/boost/mpl/aux_/msvc_eti_base.hpp @@ -49,14 +49,14 @@ template< typename T > struct msvc_eti_base { }; -#else // BOOST_MPL_CFG_MSVC_70_ETI_BUG +#else // !BOOST_MPL_CFG_MSVC_70_ETI_BUG template< typename T > struct msvc_eti_base : T { #if BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, > 0x0300) \ && BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, BOOST_TESTED_AT(0x0304)) - template< typename U > msvc_eti_base( U& x ) : T(x) {} + msvc_eti_base(); #endif typedef T type; }; diff --git a/include/boost/mpl/aux_/msvc_is_class.hpp b/include/boost/mpl/aux_/msvc_is_class.hpp index 0735230..cab4f62 100644 --- a/include/boost/mpl/aux_/msvc_is_class.hpp +++ b/include/boost/mpl/aux_/msvc_is_class.hpp @@ -18,14 +18,10 @@ #include #include #include -#include #include - -BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN - -namespace aux { +namespace boost { namespace mpl { namespace aux { template< typename T > struct is_class_helper { @@ -57,8 +53,6 @@ struct msvc_is_class { }; -} // namespace aux - -BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE +}}} #endif // BOOST_MPL_AUX_MSVC_IS_CLASS_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/na.hpp b/include/boost/mpl/aux_/na.hpp index 840515b..35096c2 100644 --- a/include/boost/mpl/aux_/na.hpp +++ b/include/boost/mpl/aux_/na.hpp @@ -19,7 +19,6 @@ #include #include - BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN // n.a. == not available @@ -29,6 +28,11 @@ struct na enum { value = 0 }; }; +BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE +BOOST_MPL_AUX_ADL_BARRIER_DECL(na) + +namespace boost { namespace mpl { + template< typename T > struct is_na : false_ @@ -98,6 +102,6 @@ template< typename T, typename U > struct if_na }; #endif -BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE +}} #endif // BOOST_MPL_AUX_NA_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/na_assert.hpp b/include/boost/mpl/aux_/na_assert.hpp index ec76448..2b28deb 100644 --- a/include/boost/mpl/aux_/na_assert.hpp +++ b/include/boost/mpl/aux_/na_assert.hpp @@ -21,12 +21,12 @@ #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) # include # define BOOST_MPL_AUX_ASSERT_NOT_NA(x) \ - BOOST_MPL_ASSERT_NOT((is_na)) \ + BOOST_MPL_ASSERT_NOT((boost::mpl::is_na)) \ /**/ #else # include # define BOOST_MPL_AUX_ASSERT_NOT_NA(x) \ - BOOST_STATIC_ASSERT(!is_na::value) \ + BOOST_STATIC_ASSERT(!boost::mpl::is_na::value) \ /**/ #endif diff --git a/include/boost/mpl/aux_/nested_type_wknd.hpp b/include/boost/mpl/aux_/nested_type_wknd.hpp index 255278e..2c51330 100644 --- a/include/boost/mpl/aux_/nested_type_wknd.hpp +++ b/include/boost/mpl/aux_/nested_type_wknd.hpp @@ -15,7 +15,6 @@ // $Revision$ #include -#include #include #if BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, BOOST_TESTED_AT(0x0302)) \ @@ -23,14 +22,12 @@ || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x530)) \ || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) -BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN -namespace aux { +namespace boost { namespace mpl { namespace aux { template< typename T > struct nested_type_wknd : T::type { }; -} -BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE +}}} #if BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) # define BOOST_MPL_AUX_NESTED_TYPE_WKND(T) \ @@ -38,7 +35,7 @@ BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE /**/ #else # define BOOST_MPL_AUX_NESTED_TYPE_WKND(T) \ - ::BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::aux::nested_type_wknd \ + ::boost::mpl::aux::nested_type_wknd \ /**/ #endif diff --git a/include/boost/mpl/aux_/type_wrapper.hpp b/include/boost/mpl/aux_/type_wrapper.hpp index 472b80b..622de3d 100644 --- a/include/boost/mpl/aux_/type_wrapper.hpp +++ b/include/boost/mpl/aux_/type_wrapper.hpp @@ -15,12 +15,9 @@ // $Date$ // $Revision$ -#include #include -BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN - -namespace aux { +namespace boost { namespace mpl { namespace aux { template< typename T > struct type_wrapper { @@ -45,8 +42,6 @@ template< typename W > struct wrapped_type }; #endif -} // namespace aux - -BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE +}}} #endif // BOOST_MPL_AUX_TYPE_WRAPPER_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/value_wknd.hpp b/include/boost/mpl/aux_/value_wknd.hpp index f2030c4..9349424 100644 --- a/include/boost/mpl/aux_/value_wknd.hpp +++ b/include/boost/mpl/aux_/value_wknd.hpp @@ -23,10 +23,8 @@ || defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG) # include -# include -BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN -namespace aux { +namespace boost { namespace mpl { namespace aux { template< typename C_ > struct value_wknd : C_ { @@ -39,8 +37,7 @@ template<> struct value_wknd using int_<1>::value; }; #endif -} // namespace aux -BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE +}}} #if !defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG) @@ -51,7 +48,7 @@ BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE #else # define BOOST_MPL_AUX_VALUE_WKND(C) C # define BOOST_MPL_AUX_MSVC_VALUE_WKND(C) \ - ::BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::aux::value_wknd< C > \ + ::boost::mpl::aux::value_wknd< C > \ /**/ #endif diff --git a/include/boost/mpl/aux_/yes_no.hpp b/include/boost/mpl/aux_/yes_no.hpp index fcaa043..7953464 100644 --- a/include/boost/mpl/aux_/yes_no.hpp +++ b/include/boost/mpl/aux_/yes_no.hpp @@ -14,15 +14,13 @@ // $Date$ // $Revision$ -#include #include #include #include #include -BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN -namespace aux { +namespace boost { namespace mpl { namespace aux { typedef char (&no_tag)[1]; typedef char (&yes_tag)[2]; @@ -55,8 +53,6 @@ template<> struct weighted_tag<0> }; #endif -} // namespace aux - -BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE +}}} #endif // BOOST_MPL_AUX_YES_NO_HPP_INCLUDED diff --git a/include/boost/mpl/integral_c_fwd.hpp b/include/boost/mpl/integral_c_fwd.hpp index 4a60062..38146c3 100644 --- a/include/boost/mpl/integral_c_fwd.hpp +++ b/include/boost/mpl/integral_c_fwd.hpp @@ -27,5 +27,6 @@ template< typename T, T N > struct integral_c; #endif BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE +BOOST_MPL_AUX_ADL_BARRIER_DECL(integral_c) #endif // BOOST_MPL_INTEGRAL_C_FWD_HPP_INCLUDED diff --git a/include/boost/mpl/integral_c_tag.hpp b/include/boost/mpl/integral_c_tag.hpp index 7054647..14f3c38 100644 --- a/include/boost/mpl/integral_c_tag.hpp +++ b/include/boost/mpl/integral_c_tag.hpp @@ -21,5 +21,6 @@ BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN struct integral_c_tag { BOOST_STATIC_CONSTANT(int, value = 0); }; BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE +BOOST_MPL_AUX_ADL_BARRIER_DECL(integral_c_tag) #endif // BOOST_MPL_INTEGRAL_C_TAG_HPP_INCLUDED diff --git a/include/boost/mpl/long_fwd.hpp b/include/boost/mpl/long_fwd.hpp index 4e1bcf2..12ad57c 100644 --- a/include/boost/mpl/long_fwd.hpp +++ b/include/boost/mpl/long_fwd.hpp @@ -22,5 +22,6 @@ BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN template< BOOST_MPL_AUX_NTTP_DECL(long, N) > struct long_; BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE +BOOST_MPL_AUX_ADL_BARRIER_DECL(long_) #endif // BOOST_MPL_LONG_FWD_HPP_INCLUDED