In C ++, I can use the typeid operator to get the name of any polymorphic class:
typeid
const char* name = typeid( CMyClass ).name();
How long will the string be pointed to by the returned const char* pointer available to my program?
const char*
While the class with rtti exists. Therefore, if you are dealing with one executable file - forever. But for classes in Dynamic Link Librariy, it changes a bit. You can potentially unload it.
The memory returned by type_info::name() will be available for the lifetime of the application.
type_info::name()
Source: https://habr.com/ru/post/886621/More articles:phpunit throws Optional exception "PHPUnit_Framework_Exception - phpneed help for zend unit test - phpHow can we create a PDF with annotation - objective-cchange the appearance of the "Edit text" window in android - androidhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/886620/will-multiple-calls-to-typeidtname-return-the-same-pointer&usg=ALkJrhigLgy-WcdhGnOlizsitj2xm0T3cwWill Apache Commons work on all servers? - javaHow can I combine route declarations (subdomain or token)? - ruby-on-railsSpeed up partitioning in Haskell - performanceMongodb: object identifier as the short primary key in the collection - mongodbHeader File Content Puzzle [Interview Question] - c ++All Articles