diff --git a/include/boost/type_traits/composite_traits.hpp b/include/boost/type_traits/composite_traits.hpp index 4ac1cda..004715b 100644 --- a/include/boost/type_traits/composite_traits.hpp +++ b/include/boost/type_traits/composite_traits.hpp @@ -69,10 +69,10 @@ namespace detail{ { pointer_helper(const volatile void*); }; - yes_type is_pointer_helper(pointer_helper); - no_type is_pointer_helper(...); + yes_type BOOST_TT_DECL is_pointer_helper(pointer_helper); + no_type BOOST_TT_DECL is_pointer_helper(...); -::boost::type_traits::no_type is_function_tester(...); +::boost::type_traits::no_type BOOST_TT_DECL is_function_tester(...); template ::boost::type_traits::yes_type is_function_tester(R (*)(void)); template @@ -140,7 +140,7 @@ template no_type is_array_helper(T*const volatile*, const volatile void*); - no_type is_array_helper(...); + no_type BOOST_TT_DECL is_array_helper(...); } // namespace detail template struct is_array @@ -871,11 +871,11 @@ template ::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29) const volatile); -::boost::type_traits::no_type is_member_function_pointer_helper(...); +::boost::type_traits::no_type BOOST_TT_DECL is_member_function_pointer_helper(...); template -::boost::type_traits::yes_type is_member_pointer_helper(R T::*); -::boost::type_traits::no_type is_member_pointer_helper(...); +::boost::type_traits::yes_type BOOST_TT_DECL is_member_pointer_helper(R T::*); +::boost::type_traits::no_type BOOST_TT_DECL is_member_pointer_helper(...); } template diff --git a/include/boost/type_traits/conversion_traits.hpp b/include/boost/type_traits/conversion_traits.hpp index 3beb5a5..cfdbb15 100644 --- a/include/boost/type_traits/conversion_traits.hpp +++ b/include/boost/type_traits/conversion_traits.hpp @@ -54,8 +54,8 @@ namespace detail{ struct from_not_void_conversion { template struct n_bind { - static no_type _m_check(...); - static yes_type _m_check(To); + static no_type BOOST_TT_DECL _m_check(...); + static yes_type BOOST_TT_DECL _m_check(To); public: void foo(); // avoid warning about all members being private static From _m_from; @@ -98,19 +98,21 @@ template struct is_convertible_helper { private: +#pragma option push -w-8074 // This workaround for Borland breaks the EDG C++ frontend, // so we only use it for Borland. template struct checker { - static type_traits::no_type _m_check(...); - static type_traits::yes_type _m_check(T); + static type_traits::no_type BOOST_TT_DECL _m_check(...); + static type_traits::yes_type BOOST_TT_DECL _m_check(T); }; static From _m_from; public: static const bool value = sizeof( checker::_m_check(_m_from) ) == sizeof(type_traits::yes_type); void foo(); // avoid warning about all members being private +#pragma option pop }; template @@ -192,8 +194,8 @@ template struct is_convertible { private: - static type_traits::no_type _m_check(...); - static type_traits::yes_type _m_check(To); + static type_traits::no_type BOOST_TT_DECL _m_check(...); + static type_traits::yes_type BOOST_TT_DECL _m_check(To); static From _m_from; public: BOOST_STATIC_CONSTANT(bool, value = sizeof( _m_check(_m_from) ) == sizeof(type_traits::yes_type)); diff --git a/include/boost/type_traits/fwd.hpp b/include/boost/type_traits/fwd.hpp index 1b14652..b85ba96 100644 --- a/include/boost/type_traits/fwd.hpp +++ b/include/boost/type_traits/fwd.hpp @@ -79,6 +79,16 @@ # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) false #endif +// +// whenever we have a conversion function with elipses +// it needs to be declared _cdecl to suppress compiler +// warnings from MS and Borland compilers: +#if defined(BOOST_MSVC) || defined(__BORLANDC__) +#define BOOST_TT_DECL _cdecl +#else +#define BOOST_TT_DECL +#endif + namespace boost{ // diff --git a/include/boost/type_traits/same_traits.hpp b/include/boost/type_traits/same_traits.hpp index 6cc4228..fc3c555 100644 --- a/include/boost/type_traits/same_traits.hpp +++ b/include/boost/type_traits/same_traits.hpp @@ -77,8 +77,8 @@ struct is_same { namespace detail{ template - ::boost::type_traits::yes_type is_same_helper(T*, T*); - ::boost::type_traits::no_type is_same_helper(...); + ::boost::type_traits::yes_type BOOST_TT_DECL is_same_helper(T*, T*); + ::boost::type_traits::no_type BOOST_TT_DECL is_same_helper(...); } template