[C++-sig] Re: args patch
David Abrahams
dave at boost-consulting.com
Mon Aug 4 05:07:05 CEST 2003
"Brett Calcott" <brett.calcott at paradise.net.nz> writes:
>> Fixed now, sorry.
>>
>
> Not checked in though?
>
> Head is still this:
>
> ----------------------------
> revision 1.17
> date: 2003/08/02 15:58:44; author: david_abrahams; state: Exp; lines:
> +11 -7
> Improved the incomplete type detection workaround for MSVC. It now
> works even with the /vmg switch which makes all member pointers the
> same size.
> ----------------------------
I beg to differ:
----------------------------
revision 1.18
date: 2003/08/03 11:48:55; author: david_abrahams; state: Exp; lines: +15 -1
Workaround for a heinous vc7 bug
----------------------------
Index: has_xxx.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/mpl/aux_/has_xxx.hpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -w -u -c -w -u -r1.17 -r1.18
cvs server: conflicting specifications of output style
cvs server: conflicting specifications of output style
--- has_xxx.hpp 2 Aug 2003 15:58:44 -0000 1.17
+++ has_xxx.hpp 3 Aug 2003 11:48:55 -0000 1.18
@@ -70,14 +70,28 @@
struct has_xxx_tag;
+# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
+ template <class U>
+ struct msvc_incomplete_array
+ {
+ typedef char (&type)[sizeof(U) + 1];
+ };
+# endif
+
template <typename T>
struct msvc_is_incomplete
{
// MSVC is capable of some kinds of SFINAE. If U is an incomplete
// type, it won't pick the second overload
static char tester(...);
+
+# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
+ template <class U>
+ static typename msvc_incomplete_array<U>::type tester(type_wrapper<U>);
+# else
template <class U>
static char(& tester(type_wrapper<U>) )[sizeof(U) + 1];
+# endif
BOOST_STATIC_CONSTANT(
bool, value = sizeof(tester(type_wrapper<T>())) == 1);
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
More information about the Cplusplus-sig
mailing list