c++ - Initialize member before base constructor. Possible? -


i have following code:

class a{ public:     a(int* i){         std::cout << "in a()" << << std::endl;     } };  class b: public a{ public:     b(): i{new int{10}}, a{i}{         std::cout << "in b()" << std::endl;      }  private:     int* i; };  int main() {     b b; } 

in a constructor have 0 (which expected). want initialize i before. possible @ all?

i data member of class b, in order created, object of class b has created first. answer, no.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -