Correct way to inherit from std::exception

后端 未结 5 1990
猫巷女王i
猫巷女王i 2020-12-04 16:04

I\'ve just created exception hierarchy and wanted to pass char* to constructor of one of my derived classes with a message telling what\'s wrong, but apparently

5条回答
  •  执笔经年
    2020-12-04 17:06

    The what method is virtual, and the meaning is that you should override it to return whatever message you want to return.

提交回复
热议问题