This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to resolve heap object`s virtual function call at compile time


Hi, everyone,
    I`ve a question about inlining virtual functions.
    G++ could inline those object`s virtual function which are allocated
on stack because they have type informations,  but how about objects
allocated on the heap? Can i force add a type info to it and let g++
resolve the virtual function call at compile time (not through vtables
). I tried use static_cast, but this would make a implicit call to ctor
. And also, pattern crtp ask you to build the whole type which means you
have to resolve all the function calls yourself.
   Thanks for you help
Best Regards


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]