|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2003-11-28 00:48:14
Eric Friedman <ebf_at_[hidden]> writes:
> 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).
Why?
>>> 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.
It's clearly not completely unrelated.
> I think maybe we should have boost::integral_constant (a la TR1)
> instead of boost::mpl::integral_c, boost::mpl::bool_, etc.
Why?
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk