DMD 1.019 and 2.003 releases

Carlos Santander csantander619 at gmail.com
Wed Jul 25 07:04:56 PDT 2007


Walter Bright escribió:
> 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.
> 

Lost me here. If both of them are still virtual, how could I "split them apart 
with getVirtualFunctions"?

>>
>> As for casting, cast A.foo to what?
>>
> 
> To the type signature of the particular overload you want.

__traits(isAbstractFunction, cast (int delegate (int) ) A.foo)    ?

-- 
Carlos Santander Bernal



More information about the Digitalmars-d-announce mailing list