|
|
|
|
|
by userbinator
2622 days ago
|
|
With the C++, there is also an optimisation which can be performed: put the method pointers in the object itself, instead of in a vtable. This is beneficial when there aren't so many objects nor methods, since it eliminates one indirection. Instead of obj->table.method() it turns into obj->method(). When I write "OOP" code in C, I usually do this instead of using a separate vtable. As an aside, I noticed the word "klass", then looked up at the domain name and confirmed my suspicions. ;-) |
|