vendredi 26 août 2016

Function resolution from vtable in C++

I have a confusion regarding vtable after reading more about name mangling. for ex:

class A
{
public:
    void hello()
    {
        ....
    }
};

A obj;
obj.hello();

As per my understanding after the name manging obj.hello() call will be converted to something like _ZASDhellov(&obj) now

  1. how this virtual functions will be invoked from vtable?
  2. my wild guess obj.__vtable[_ZASDhellov](&obj) is correct?
  3. How the function names are resolved from vtable?

Aucun commentaire:

Enregistrer un commentaire