Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2002-02-24 07:06:07


>Have you found some advantages to passing tags by const reference instead
of
>by-value?

I tend not to use type traits that way at all, so I have no idea whether it
make any difference (although Borland doesn't inline functions taking
"class by value"). you could also overload by pointer to
true_type/false_type and use:

        static_cast<has_trivial_destructor<T>*>(0)

so that no temporary is created at all (I realise it should be optimised
away, but you never know).

>What did you have in mind, edits to the proposal, or re-writing the entire
>library and a batallion of associated tests? ;-)

The proposal is backward compatible so no tests need change. I was going
to leave things as they were, but flag the issue up for the committee, so
that it could be discussed. If you want to move faster than that then do
as much or as little as you want ;-)

WRT the implementation, the change would entail basically putting all the
existing code into a detail namespace, and then adding thin wrappers:

template <class T>
struct is_void : public boolian_traits< ::boost::detail::is_void<T>::value>
{};

assuming that doesn't mess up any compilers, which seems fairly likely
given our luck in this area so far :-(

- John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/


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