Boost logo

Boost :

Subject: Re: [boost] [type_traits] Rewrite and dependency free version
From: John Maddock (boost.regex_at_[hidden])
Date: 2015-01-20 08:14:52


>>> Wasn't this macro a VC6 workaround?
>>>
>>> As a first step we could just add an empty macro and see if anything
>>> today actually needs it.
>>
>> That's what I was planning, these macros are all basically superfluous
>> now.
>
> I am seeing in MPL empty_base.hpp:
>
> #include <boost/type_traits/detail/bool_trait_def.hpp>
>
> but this file does not exist in type_traits Version2.

I've added back "do nothing much" versions of those missing files. A
lot more should build now.

However, there are a couple of show-stoppers I don't know how to solve:

1) boost::integral_constant is no longer a model of mpl's
integral_constant:
http://www.boost.org/doc/libs/1_57_0/libs/mpl/doc/refmanual/integral-constant.html

As a result all of function_types lib is broken. I guess one could
argue that if you want to do arithmetic on integral_constant's then one
should use MPL all the way through. But it's a big breaking change.

2) There are few places (well, myself in multiprecision lib) where folks
do dispatch on multiple conditions:

do_something(mpl::true_ const&, mpl::true_ const&){}
do_something(mpl::true_ const&, mpl::false_ const&){}
template <bool B>
do_something(mpl::true_ const&, mpl::bool_<B> const& {/*catch all case*/}

Then:

do_something(trait1<T>(), trait2<T>());

The problem here is that the final catch all case can not be found
unless trait2 actually inherits from mpl::bool_ rather than being merely
convertible to it.

John.


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