DMD 1.019 and 2.003 releases
Walter Bright
newshound1 at digitalmars.com
Tue Jul 24 21:29:24 PDT 2007
Carlos Santander wrote:
> Walter Bright escribió:
>> Carlos Santander wrote:
>>> How can we check specific overloads with __traits? For example,
>>>
>>> class A
>>> {
>>> abstract void foo();
>>> int foo(int i) { return i; }
>>> }
>>>
>>> void main ()
>>> {
>>> auto isvirtual = __traits(isAbstractFunction, A.foo); // what is it?
>>> }
>>
>> You'll need to split them apart with getVirtualFunctions, or cast the
>> A.foo.
>>
>
> As for getVirtualFunctions, I'm guessing abstract foo would not be
> virtual, and the other one would. Am I right?
Abstractness is orthogonal to virtualness - in this case, they're still
virtual.
>
> As for casting, cast A.foo to what?
>
To the type signature of the particular overload you want.
More information about the Digitalmars-d-announce
mailing list