Exception multiple inheritance

后端 未结 1 1258
名媛妹妹
名媛妹妹 2020-12-17 04:28

I have the problem with mixing exceptions and multiple inheritance. Basically I have this code:

#include 

        
相关标签:
1条回答
  • 2020-12-17 05:16

    Stroustrup recommends to inherit from std::exception virtually, so that there is only one conversion path.

    Personally, I find that working out a multiple inheritance scheme is probably over-engineering and prefer a linear inheritance chain... or just none at all.

    0 讨论(0)
提交回复
热议问题