C++ için oldukça yeni ve std :: exception'dan genişletilmiş özel bir özel durum için aşağıdaki kod parçacığını buldum. Anlamadığım tek kısım, kurucu tanımından sonra : err_msg(msg) {}
'dur. Herkes bunun neden parantez içinde olmadığını açıklayabilir mi?C++ sözdizimi
class my_exception : public std::exception {
private:
std::string err_msg;
public:
my_exception(const char *msg) : err_msg(msg) {};
~my_exception() throw() {};
const char *what() const throw() { return this->err_msg.c_str(); };
};