Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-03-05 00:57:41

Granted, Aleksey, but the case in question can be handled without remove_cv,
as I've illustrated. No need for workarounds (at least not these ones ;-)).


----- Original Message -----
From: "Aleksey Gurtovoy" <alexy_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Sunday, March 04, 2001 11:51 PM
Subject: RE: [boost] Re: FW: converting shared_ptr<const T> to shared_ptr<

> David Abrahams wrote:
> > No, because remove_cv<> doesn't work without partial
> > specialization.
> Strictly speaking, that's true; I just wanted to note that the latest
> version of the 'type traits' library (in CVS) makes the above assertion
> so flat. From the library documentation:
> for partial specialization of class templates is required to
> correctly implement the type transformation templates. On the other hand,
> practice shows that many of the templates from this category are very
> useful, and often essential for implementing some generic libraries. Lack
> these templates is often one of the major limiting factors in porting
> libraries to compilers that do not yet support this language feature. As
> some of these compilers are going to be around for a while, and at least
> of them is very wide-spread, it was decided that the library should
> workarounds where possible. The basic idea behind the workaround is
> 1. To manually define full specializations of all type transformation
> templates for all fundamental types, and all their 1st and 2nd rank
> cv-[un]qualified derivative pointer types, and to
> 2. Provide a user-level macro that will define such explicit
> for any user-defined type T.
> The first part guarantees the successful compilation of something like
> BOOST_STATIC_ASSERT((is_same<char,
> ...
> BOOST_STATIC_ASSERT((is_same<char const volatile* const volatile* const
> volatile, remove_reference<char const volatile* const volatile* const
> volatile&>::type>::value));
> and the second part provides library's users with a mechanism to make the
> above code work not only for 'char', 'int' or other built-in type, but for
> they own types too:
> struct my {};
> BOOST_STATIC_ASSERT((is_same<my, remove_reference<my&>::type>::value));
> BOOST_STATIC_ASSERT((is_same<my, remove_const<my const>::type>::value));
> // etc.
> evaluates to nothing on those compilers that do support partial
> specialisation.
> Aleksey
> Your use of Yahoo! Groups is subject to

Boost list run by bdawes at, gregod at, cpdaniel at, john at