mirror of
https://github.com/boostorg/type_traits.git
synced 2025-08-02 22:14:29 +02:00
Stop passing UDT's through ellipsis - it messes up strictly conforming compilers (EDG and Metrowerks).
Tighten up the tests for function and member [function] types. [SVN r29431]
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
namespace boost {
|
||||
namespace type_traits {
|
||||
|
||||
// Note it is acceptible to use ellipsis here, since the argument will
|
||||
// always be a pointer type of some sort (JM 2005/06/04):
|
||||
no_type BOOST_TT_DECL is_function_ptr_tester(...);
|
||||
|
||||
#if !defined(BOOST_TT_PREPROCESSING_MODE)
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -61,7 +61,7 @@ struct is_mem_fun_pointer_select<false>
|
||||
{
|
||||
template <typename T> struct result_
|
||||
{
|
||||
static T& make_t;
|
||||
static T* make_t;
|
||||
typedef result_<T> self_type;
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
@@ -92,7 +92,7 @@ struct is_member_function_pointer_impl<T&> : public false_type{};
|
||||
template <typename T>
|
||||
struct is_member_function_pointer_impl
|
||||
{
|
||||
static T& m_t;
|
||||
static T* m_t;
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value =
|
||||
(1 == sizeof(type_traits::is_mem_fun_pointer_tester(m_t))) );
|
||||
|
@@ -53,7 +53,7 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,
|
||||
namespace detail {
|
||||
|
||||
template <typename R, typename T>
|
||||
::boost::type_traits::yes_type BOOST_TT_DECL is_member_pointer_tester(R T::*);
|
||||
::boost::type_traits::yes_type BOOST_TT_DECL is_member_pointer_tester(R T::**);
|
||||
::boost::type_traits::no_type BOOST_TT_DECL is_member_pointer_tester(...);
|
||||
|
||||
template <bool>
|
||||
@@ -67,7 +67,7 @@ struct is_member_pointer_select<false>
|
||||
{
|
||||
template <typename T> struct result_
|
||||
{
|
||||
static T& make_t();
|
||||
static T* make_t();
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
|
@@ -28,6 +28,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<foo4_t>::value, true);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<void>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<int>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<int&>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<int*>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<int[]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<test_abc1>::value, false);
|
||||
|
@@ -27,6 +27,11 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<mp>::value, false
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<void>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<test_abc1>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<foo0_t>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<int&>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<const int&>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<const int[2] >::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<const int[] >::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<void>::value, false);
|
||||
|
||||
#ifdef BOOST_TT_TEST_MS_FUNC_SIGS
|
||||
typedef void (__stdcall test_abc1::*scall_proc)();
|
||||
|
@@ -28,6 +28,15 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<void>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<test_abc1>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<foo0_t>::value, false);
|
||||
|
||||
#ifdef BOOST_TT_TEST_MS_FUNC_SIGS
|
||||
typedef void (__stdcall test_abc1::*scall_proc)();
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<scall_proc>::value, true);
|
||||
typedef void (__fastcall test_abc1::*fcall_proc)(int);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<fcall_proc>::value, true);
|
||||
typedef void (__cdecl test_abc1::*ccall_proc)(int, long, double);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<ccall_proc>::value, true);
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user