Calling member functions from a constructor

后端 未结 5 891
我在风中等你
我在风中等你 2020-12-29 08:17

I know this question has a similar title to this: C++: calling member functions within constructor? but I am asking a more general question.

Is it good practice to c

5条回答
  •  天命终不由人
    2020-12-29 08:44

    I'm more familiar with C++ than Python, but I see no problem with calling member functions from constructors, especially when this practice is able to factor out similar code from multiple constructors. Anything that reduces redundancy is good in my books.

提交回复
热议问题