Boost logo

Boost :

Subject: Re: [boost] New dependency report
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2014-06-09 03:50:31


Le 09/06/14 00:46, Peter Dimov a écrit :
> Andrey Semashev wrote
>> mpl::bool_ is not the only thing TypeTraits uses from MPL, so this
>> dependency won't go that easily.
>
> The list appears long, ...
>
> http://www.pdimov.com/tmp/report-b932921/type_traits.html#mpl
>
> ... but most of the nontrivial metaprogramming is done by common_type.
> The other contenders are floating_point_promotion and
> detail/template_arity_spec.
|The floating_point_promotion dependency is only if
BOOST_NO_CV_SPECIALIZATIONS is defined.
Do we support compiler defining this?

$ grep -r BOOST_NO_CV_SPECIALIZATIONS *
boost/config/compiler/borland.hpp:# define BOOST_NO_CV_SPECIALIZATIONS
boost/config/compiler/mpw.hpp:# define BOOST_NO_CV_SPECIALIZATIONS
boost/config/suffix.hpp:# if defined(BOOST_NO_CV_SPECIALIZATIONS) \

The detail/template_arity_spec dependency more complex.

<boost/mpl/aux_/config/lambda.hpp>
     from <boost/type_traits/detail/template_arity_spec.hpp>
<boost/mpl/aux_/config/overload_resolution.hpp>
     from <boost/type_traits/detail/template_arity_spec.hpp>
<boost/mpl/aux_/preprocessor/params.hpp>
     from <boost/type_traits/detail/template_arity_spec.hpp>
<boost/mpl/aux_/template_arity_fwd.hpp>
     from <boost/type_traits/detail/template_arity_spec.hpp>

If we had simplified version of integral_constant, conditional, and_,
or_, boo_, int_

The following dependencies could be resolved
<boost/mpl/and.hpp>

     from <boost/type_traits/is_virtual_base_of.hpp>

<boost/mpl/bool.hpp>

     from <boost/type_traits/detail/bool_trait_def.hpp>
     from <boost/type_traits/integral_constant.hpp>

refactor integral_constant.hpp and bool_trait_def.hpp and to don't
depend on mpl/bool.hpp, but on type_traits_core/integral_constant.hpp.

<boost/mpl/if.hpp>

     from <boost/type_traits/conditional.hpp>

Define it independently of mpl/if.hpp. type_traits_core/conditional.hpp.

     from <boost/type_traits/make_signed.hpp>
     from <boost/type_traits/make_unsigned.hpp>
     from <boost/type_traits/type_with_alignment.hpp>

Refactor them to use conditional

<boost/mpl/int.hpp>

     from <boost/type_traits/detail/template_arity_spec.hpp>
     from <boost/type_traits/floating_point_promotion.hpp>

Make use directly of integral_constant<int,N> or define a
type_traits::int_<N>
<boost/mpl/integral_c.hpp>

     from <boost/type_traits/integral_constant.hpp>

Don't use any more intergral_c. Use type_traits_core/integral_constant.hpp
<boost/mpl/not.hpp>

     from <boost/type_traits/is_virtual_base_of.hpp>

Add type_traits_core/not.hpp

<boost/mpl/size_t.hpp>

     from <boost/type_traits/detail/size_t_trait_def.hpp>

Use type_traits_core/integral_constant.hpp
There are yet these dependencies to resolve
<boost/mpl/aux_/lambda_support.hpp>

     from <boost/type_traits/detail/bool_trait_def.hpp>
     from <boost/type_traits/detail/size_t_trait_def.hpp>
     from <boost/type_traits/detail/type_trait_def.hpp>

<boost/mpl/eval_if.hpp>

     from <boost/aligned_storage.hpp>
     from <boost/type_traits/decay.hpp>
     from <boost/type_traits/integral_promotion.hpp>

<boost/mpl/identity.hpp>

     from <boost/aligned_storage.hpp>
     from <boost/type_traits/decay.hpp>
     from <boost/type_traits/integral_promotion.hpp>|
>
> The reverse,
>
> http://www.pdimov.com/tmp/report-b932921/mpl.html#type_traits
>
> looks breakable as well.

How do you want to break it? Duplicating what is used?

Best,
Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk