[C++-sig] Re: args patch

David Abrahams dave at boost-consulting.com
Sat Aug 2 13:46:17 CEST 2003


Aleksey Gurtovoy <agurtovoy at meta-comm.com> writes:

> David Abrahams wrote:
>> Nikolay Mladenov <nickm at sitius.com> writes:
>>
>> > The change that breaks it has happened between Feb 06 2003 and Feb 07
>> > 2003
>> > and as far as I can tell it comes from:
>> > mpl/aux_/has_xxx.hpp around line 79
>> > the definition of struct msvc_is_incomplete
>> > and than detail/iterator.hpp around line 83
>> > What do you think, can it be fixed?
>>
>> Hmm, it looks like /vmg has to completely break that
>> msvc_is_incomplete template:
>>
>>     template< typename T >
>>     struct msvc_is_incomplete
>>     {
>>         struct incomplete_;
>>         BOOST_STATIC_CONSTANT(bool, value =
>>               sizeof(void (T::*)()) == sizeof(void (incomplete_::*)())
>>             );
>>     };
>>
>> I think msvc_is_incomplete<T>::value would always be true.
>
> Yeah. Unfortunately, that's the only way I know to implement 'has_xxx' on
> MSVC so that it doesn't bark on incomplete types, and there is some code
> around which relies on it. 


It seems to me that it can't know the answer for incomplete types, and
therefore it shouldn't produce one - it should be an error.  How does
the conforming version manage it?

> On the other hand, Boost.Python probably doesn't depend on it

Right.

> and since '/vmg' is not the default option, what we _can_ do is to
> guard the 'is_incomplete' check with something like
> BOOST_MPL_AUX_HAS_XXX_MSVC_NO_IS_INCOMPLETE and ask to define the
> symbol when compiling with '/vmg' or '#pragma
> pointers_to_members(full_generality, ..)'.

Sounds like a plan.

> If that sounds like a reasonable compromise - in particular, to
> Nikolay - please feel free to implement it.

Nikolay, let me know what you think.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list