Boost logo

Boost :

From: Eric Friedman (ebf_at_[hidden])
Date: 2003-11-27 23:38:44


David Abrahams wrote:
> Eric Friedman <ebf_at_[hidden]> writes:
>
>
>>It seems to me the standard form of such a specialization would look
>>as follows:
>>
>>// ...at file scope...
>>namespace boost {
>>
>> template <>
>> struct has_nothrow_copy< myUDT >
>> : mpl::true_
>> {
>> };
>>
>>}
>>
>>The problem I see here is this approach (needlessly) forces MPL upon
>>the user.
>
>
> It's not needless. You're going to force *something* upon the user.
> Why not boost/mpl/bool.hpp?
>

But why? The type traits library should have nothing to do with MPL (at
least from a user's perspective).

>> 1) Provide a typedef of boost::mpl::true_ named boost::true_, or
>> perhaps boost::tt_true to keep it Type Traits-specific. (I suppose
>> we could do the same for false_.)
>
>
> What problem is this solving? Just that they don't have to write the
> letters "mpl"?

Yes. I believe it is confusing for a user who is seeking simply to
specialize a type trait to have to think about an unrelated library.

I think maybe we should have boost::integral_constant (a la TR1) instead
of boost::mpl::integral_c, boost::mpl::bool_, etc.

I do want to be reasonable though: this isn't a critical issue. It just
seems to me we'd want to clear it up now if possible so we aren't stuck
with it later.

Eric


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