C++ 中的 protected

来源:互联网 发布:日本文化 知乎 编辑:程序博客网 时间:2024/06/06 00:13


C++ 中的 protected

    class exception : public std::exception    {        public:            exception(const exception& exception_) : message(exception_.message) {}            exception(const std::string& message_) : message(message_) {}            ~exception() throw() {}            const char* what() const throw() { return message.c_str(); }        protected:            std::string message;    };