Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22070

Will compiler create vtable irrespective of object creation in c++

$
0
0
class B 
{ 

public: virtual void fun1() {} 

};

class D: public B 
{ 

public: virtual void fun1() {} 

};

int main() 
{ 

//Empty Main. 

//Not creating any object of B or D. 

return 0; 

}

In GCC or Visual Studio, will the compiler create any vTable here?

As per my understanding it should not create any vTables because we didn't create any B or C obj. So no need to create I think.

Am I correct?


Viewing all articles
Browse latest Browse all 22070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>