Hi Matt,1.I would like to ask that compiler explorer having c++ examples in its repository that can be run on it or you suggest some good way of learning c++.2. Various option like command line arguments are not still visible to me.ThanksOn Sat, 20 Mar 2021, 01:02 Matt Godbolt, <ma...@godbolt.org> wrote:Hi Kunal,1. I still have doubt for line "// Constructor and destructor defined out of line to force code generation" what does it mean exactly.This is just something I'm observed - compilers don't even "make" the vtable until they know it's used. By definitng the constructor and destructor out of line, this forces it.2. As I am writing some code of classes I have not defined constructor etc, but by default as per theory it should created by compiler , but I am not able to see something like that.Right; the compiler doesn't need to create the table until someone constructs an object. It's avoiding work.> May be it will not be good to ask , but still i am asking as your are a c++ expert some hints how to learn typical c++ concept like vptr, vtable and others.Most C++ developers don't need to know much about the mechanics of vtables etc - I applaud you digging deeper :) A book I've seen recommended is https://www.amazon.com/Inside-Object-Model-Stanley-Lippman/dp/0201834545 - but I don't know how good it is. I've picked up most of the information by reading blogs and similar along the way. Jason Turner's c++ weekly has a lot of bite-sized YouTube videos that sometimes cover this kind of stuff too.Hope that helps, sorry I'm not doing a good job of explaining very well :(--mattOn Fri, Mar 19, 2021 at 2:28 PM Kunal Chauhan <atkunal...@gmail.com> wrote:Hi Matt,May be it will not be good to ask , but still i am asking as your are a c++ expert some hints how to learn typical c++ concept like vptr, vtable and others.On Thu, 18 Mar 2021, 23:24 Kunal Chauhan, <atkunal...@gmail.com> wrote:Thanks Matt for references .1. I still have doubt for line "// Constructor and destructor defined out of line to force code generation" what does it mean exactly.2. As I am writing some code of classes I have not defined constructor etc, but by default as per theory it should created by compiler , but I am not able to see something like that.On Thu, Mar 18, 2021 at 10:54 PM Matt Godbolt <ma...@godbolt.org> wrote:Hi Kunal,I'm glad you're finding Compiler Explorer useful!To see virtual tables, note they are only output by most compielrs on the first out-of-line definition. Something like: https://godbolt.org/z/jc1GqbHope that helps, I'm no expert on vtable layout but I can muddle through it...--mattOn Thu, Mar 18, 2021 at 5:56 AM Kunal Chauhan <atkunal...@gmail.com> wrote:Hi Maat,1.It is very nice to use compiler explore to see the internal code working.2. Still I have query as I am learning C++ and want to explorer the virtual and vptr related code like how it sees or put by compiler . So Can I see vptr variables pointer in compiler explorer and as well as the Class internal code like default constructor etc. how these all stuff is created by the compiler in the backend.----Matt(he/him)--
--Matt(he/him)