Boost logo

Boost Testing :

From: John Maddock (john_at_[hidden])
Date: 2005-06-06 11:15:59


> did you get it in the mean time from my colleague?

Yes, thankyou, I've been away from the desk.

> Well writing the patch it gets even weirder (at end of mail ; not in an
> attach though because I have some trouble with attachments apparantly).
> I first tried to patch it by verifying that
> BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED was NOT defined and only in that case
> to forward-declare is_convertible. However this does not work (because it
> apparantly is defined) so I left it out. Nevertheless I find this very
> strange and do not understand at all what is happening.

I think I've tracked down the problem: there's a cyclic header dependency,
that only occurs for certain compilers:

If BOOST_NO_IS_ABSTRACT is *not* defined, then:

is_convertible.hpp includes is_abstract.hpp, which requires is_class.hpp,
which *may* require is_enum.hpp, which requires is_convertible !

Now, for every other compiler that doesn't define BOOST_NO_IS_ABSTRACT, this
dependency doesn't occur, because is_class uses SFINAE, rather than the "not
any other type" approach.

So..... do the configure tests pass? Do we need to define
BOOST_NO_IS_ABSTRACT? If so then the problem goes away.

Otherwise, if is_abstract works, then I'm assuming that SFINAE works also,
and we can use the conforming version of is_class by defining
BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION in the type_traits
configuration (I think this macro should probably depend upon
BOOST_NO_SFINAE, but it's too close to release to risk that change).

I think BOOST_NO_IS_ABSTRACT should be defined automatically when
BOOST_NO_SFINAE is set as well, but again, I think that's one for after the
release.

Hope this helps to clear things up, and not muddy them further!

John.

> Index: is_enum.hpp
> ===================================================================
> RCS file: /cvsroot/boost/boost/boost/type_traits/is_enum.hpp,v
> retrieving revision 1.13
> diff -u -r1.13 is_enum.hpp
> --- is_enum.hpp 30 Jan 2005 15:41:12 -0000 1.13
> +++ is_enum.hpp 6 Jun 2005 13:40:12 -0000
> @@ -31,6 +31,14 @@
>
> namespace boost {
>
> +#if BOOST_WORKAROUND(__IBMCPP__,<=600)
> + // Although is_convertible.hpp is included above, the vacpp
> + // preprocessor apparantly skips it. Therefore we forward-declare
> + // the struct here and assume (and experienced) that it will
> + // be included succesfully later on
> + template < typename From, typename To > struct is_convertible ;
> +#endif // BOOST_WORKAROUND(__IBMCPP__,<=600)
> +
> #if !(defined(__BORLANDC__) && (__BORLANDC__ <= 0x551))
>
> namespace detail {
>
>
>
>
> _______________________________________________
> Boost-Testing mailing list
> Boost-Testing_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-testing
>


Boost-testing list run by mbergal at meta-comm.com