Silly question

Jarrett Billingsley kb3ctd2 at yahoo.com
Wed Apr 23 17:22:53 PDT 2008


"Steven Schveighoffer" <schveiguy at yahoo.com> wrote in message 
news:fuo7ac$17mn$1 at digitalmars.com...
> Are private functions that aren't declared final in the vtable?  Instinct 
> tells me they should not be, but maybe they are...
>
> -Steve
>

They aren't, at least what a little experiment shows:

class A
{
    public void foo() {}
}

class B
{
    private void bar() {}
}

void main(char[][] args)
{
    Stdout.formatln("{}", Object.classinfo.vtbl.length);
    Stdout.formatln("{}", A.classinfo.vtbl.length);
    Stdout.formatln("{}", B.classinfo.vtbl.length);
}

prints 5, 6, 5. 




More information about the Digitalmars-d-learn mailing list