ility to distinguinish between
different "things" passed to a template alias paramter? - Like "isType",
"isVariable", "isLiteral", "isTemplate" ...
enuhtac
Am 03.04.2011 16:11, schrieb Philippe Sigaud:
> On Sat, Apr 2, 2011 at 13:05, enuhtac wrote:
>> This is the type I would like to check for:
>>
>> struct A( T, string s )
>> { ... };
> Hi,
>
> the trick is to use a function do the work for you. Let's define
Am 02.04.2011 04:00, schrieb Caligo:
> On Fri, Apr 1, 2011 at 5:14 PM, enuhtac wrote:
>> Hello,
>>
>> the "is" expression is a great feature of D - but its use is not very
>> intuitive, at least for me.
>> I'm trying to write a template that figure
Am 02.04.2011 11:24, schrieb spir:
> On 04/02/2011 12:14 AM, enuhtac wrote:
>> template isA( T )
>> {
>> static if( is( T U == A!( U, s ), string s ) )
>> enum bool isA = true;
>> else
>> enum bool isA = false;
>> };
>
is" expression. As I understand "is" it should
be done like this:
template isA( T )
{
static if( is( T U == A!( U, s ), string s ) )
enum bool isA = true;
else
enum bool isA = false;
};
But this does not work. So what am I doing wrong?
Regards,
enuhtac
write additional code.
But these workarounds are ugly, if would greatly prefer the normal comparison
operators.
Does anyone has an idea how to use them?
Regards,
enuhtac
--
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl