Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-01-24 20:19:39

"Daryle Walker" <darylew_at_[hidden]> wrote in message
> On 1/21/04 5:25 PM, "Howard Hinnant" <hinnant_at_[hidden]> wrote:
> [SNIP]
> > With move_ptr<T[]> you (or at least I) immediately think: Ok, a
> > pointer to an array.
> I forgot; will "T[]" resolve to an array type? In function
parameters, it
> reduces to "T*", which is something unsuitable here if the same
> happens.

Hi Daryle,

Are you thinking of something like this:

    template<typename T>
    void f(T t)
        BOOST_STATIC_ASSERT((boost::is_same<T, int* >::value));

    int main()
        int a[100];


Here 'a' is converted to int* before template argument deduction, so T
is deduced to be int*. This applies only to function templates, and
doesn't happen at all if the template argument is explicitly


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