问题
I was playing around with DIA SDK today, trying to print all the functions in a .pdb file generated by VS(2012). In the output I noticed a function called __autoclassinit( with an unsigned int as a parameter ) was generated for one my test classes (the only with with a pointer member).
Google failed to return any results so I ask you: what does this function do? and why isn't it used for references too?
回答1:
First google hit for "__autoclassinit"
blogs.msdn.com...
...compiler will generate a new function called A::_autoclassinit(). This function is responsible for the initialization of class member pointers. It will also call the compiler-generated class initialization functions of any base classes or member variable of a class type. For our example the A::_autoclassinit() function is called before the call to the constructor: ...
来源:https://stackoverflow.com/questions/20514856/visual-studio-auto-generated-function-only-when-class-has-pointer-member