mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-05 15:54:39 +02:00
Improved the incomplete type detection workaround for MSVC. It now
works even with the /vmg switch which makes all member pointers the same size. [SVN r19402]
This commit is contained in:
@@ -3,8 +3,8 @@
|
|||||||
// See http://www.boost.org for updates, documentation, and revision history.
|
// See http://www.boost.org for updates, documentation, and revision history.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Copyright (c) 2002
|
// Copyright (c) 2002-2003
|
||||||
// Aleksey Gurtovoy
|
// Aleksey Gurtovoy and David Abrahams
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Permission to use, copy, modify, distribute and sell this software
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// and its documentation for any purpose is hereby granted without fee,
|
||||||
@@ -70,13 +70,17 @@ namespace boost { namespace mpl { namespace aux {
|
|||||||
|
|
||||||
struct has_xxx_tag;
|
struct has_xxx_tag;
|
||||||
|
|
||||||
template< typename T >
|
template <typename T>
|
||||||
struct msvc_is_incomplete
|
struct msvc_is_incomplete
|
||||||
{
|
{
|
||||||
struct incomplete_;
|
// MSVC is capable of some kinds of SFINAE. If U is an incomplete
|
||||||
BOOST_STATIC_CONSTANT(bool, value =
|
// type, it won't pick the second overload
|
||||||
sizeof(void (T::*)()) == sizeof(void (incomplete_::*)())
|
static char tester(...);
|
||||||
);
|
template <class U>
|
||||||
|
static char(& tester(type_wrapper<U>) )[sizeof(U) + 1];
|
||||||
|
|
||||||
|
BOOST_STATIC_CONSTANT(
|
||||||
|
bool, value = sizeof(tester(type_wrapper<T>())) == 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
Reference in New Issue
Block a user