|
Boost : |
From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2000-12-24 08:35:33
John Maddock wrote:
> That's seriously inventive
Thanks :)
> but I don't think it makes anything work that
> doesn't work already (using conformant code), I'd prefer to keep
> the number
> of compiler-specific versions to a minimum unless there is some compelling
> reason not to do so.
Fair enough, but there are two particular reasons why I would like to see
these templates in place of current ones (for MSVC):
1) they can be used on incomplete types, e.g. you can do this:
struct my;
BOOST_STATIC_ASSERT((boost::is_same<my, my>::value));
BOOST_STATIC_ASSERT(boost::is_const<my const&>::value);
2) the current implementation of 'is_same' (in the
'boost/details/ob_type_traits.hpp' header) internally uses 'is_reference'
template, which, in its turn, uses 'is_const' and 'is_volatile', and
therefore usage of 'is_same' inside (intensively) recursive templates can be
a limiting factor, as it reduces the number of recursively nested template
instantiations available at user's level; it's a real problem I came across
of, and although using a "self-sufficient" implementation of 'is_same' is
not going to solve it completely, in many cases it's enough to get the
compiler eat the code.
> (I will add an add_reference though for VC6).
Thank you :)
--Aleksey
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk