?? status.hpp
字號:
// status.hpp An Object Error Status class, to be inherited by// classes that need it. Inherit this class as public VIRTUAL// Note: This class cannot be inherited by classes for which the// ! operator or a cast to an int would make sense// rcsid: @(#)status.hpp 1.1 13:33:52 10/14/93 EFC#ifndef STATUS_HPP_#define STATUS_HPP_ 1.1class ErrorStatus{ protected: int err_flag; virtual void set_flag(const int flag) { err_flag = flag; } virtual void reset_flag() { err_flag = 0; } ErrorStatus() : err_flag(0) {} public: virtual ~ErrorStatus() {} // getting the status of the object // the actual status flag virtual int status() { return err_flag; } // nonzero if good operator int() { return status() == 0; } // nonzero if bad int operator!() { return status() != 0; }};#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -