Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-01-26 19:33:23


"Daryle Walker" <darylew_at_[hidden]> wrote in message:

> On 1/24/04 8:19 PM, "Jonathan Turkanis" <technews_at_[hidden]>
wrote:
>

> > Are you thinking of something like this: <snip>

>
> No, I'm not.

Sorry I misunderstood you.

>
<snip>
>
> I meant the template and function resolutions of "T[]" to be
separate and
> parallel analogies, not merged together. ...

I don't understand this sentence.

> For functions:
>
> whatever function1( T[] t );
> whatever function2( T* t );
>
> these are considered the same. What about:
>
> template < typename U > class my_template;
> //...
> template < typename T > class my_template<T[]> { /*...*/ };
> template < typename T > class my_template<T*> { /*...*/ };
>
> Are those last two entries considered the same? If so, then we
can't use
> this technique.

I understand your question now. The equivalence of the function
declarations is a rule specific to overloading (13.1/3), which does
not apply here. When two argument lists are considered equivalent for
the purposes of partial specialization should be covered by 14.5.4,
and I don't see any statement there to indicate that T* and T[] are to
be treated as equivalent.

Better evidence, of course, is that Howard says its okay. :-)

Jonathan


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