Re: Virtual table in class without overloading

2018-04-28 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 28 April 2018 at 11:52:50 UTC, Jonathan M Davis wrote: unless you're declaring the type as a class purely so that it's forced to be a reference type. You can do a struct as a reference type too - just make it a pimpl handle.

Re: Virtual table in class without overloading

2018-04-28 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, April 28, 2018 11:04:56 Andrey via Digitalmars-d-learn wrote: > Hello, > I have some questions about virtual table in classes. > Example 1: > > class Test > { > void someMethod() { ... } > int anotherMethod { ... } > } > > Will this class have a vtable? > > Example 2: >

Virtual table in class without overloading

2018-04-28 Thread Andrey via Digitalmars-d-learn
Hello, I have some questions about virtual table in classes. Example 1: class Test { void someMethod() { ... } int anotherMethod { ... } } Will this class have a vtable? Example 2: class Test2 : Test { void thirdMethod() { ... } } Will this class have a vtable? In C++ these