template specialization for arrays

J Arrizza cppgent0 at gmail.com
Sat Oct 29 17:31:10 PDT 2011


On Sat, Oct 29, 2011 at 5:16 PM, Jonathan M Davis <jmdavisProg at gmx.com>wrote:

> > and get compiler ambiguity for abc("str") between the two templates
> above.
>
> Of course you do. A narrow string is a dynamic array, so it matches both.
> You
> need to change the second constraint to if(isDynamicArray!T &&
> !isNarrowString!T), then narrow strings won't match both.
>
> - Jonathan M Davis
>

Yup, just tried it and works fine.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20111029/02d5c6d2/attachment.html>


More information about the Digitalmars-d mailing list