Accessing template parameters from outside?

Stewart Gordon smjg_1998 at yahoo.com
Tue Apr 25 07:02:11 PDT 2006


Oskar Linde wrote:
<snip>
> The shortest fix to do the above I can think of is:
> 
>   } else static if(is(typeof(content.data))) {
>     printf("Container for vector %i\n",content.data.length);
<snip>

How about

is(T : vector!(content.data.length)))

which will make sure it really is a vector and not just an arbitrary 
type with a member called data?

But I think you're right that the only solution we have at the moment is 
to use template-specific features.

Stewart.



More information about the Digitalmars-d mailing list