Extending enum in derived classes

前端 未结 8 2356
陌清茗
陌清茗 2021-02-13 03:53

I have a class hierarchy, and each class in it has an exception class, derived in a parallel hierarchy, thus...

class Base
{
};

class Derived : public Base
{
};         


        
8条回答
  •  难免孤独
    2021-02-13 04:33

    The "reason" of the exception is most likely something that needs to be shown to the user or to be logged, so a string seems more appropriate, so it can be used in what().
    If it is more than that, more subclassing is needed.

提交回复
热议问题