exception.h
来自「C++神经网络开发包ANNIE」· C头文件 代码 · 共 39 行
H
39 行
#ifndef _EXCEPTION_H#define _EXCEPTION_H#include <iostream>#include <string>namespace annie{/** A common exception class used by all classes in the annie library. * You should place calls to functions that can throw exceptions in a try {} block, * and catch(Exception &e). Use cout<<e.what() to print out the details onto the screen. * * In version 1.0 of annie, this is the only class thrown by any function. Further refinements * will be made as and when required. */class Exception{protected: std::string details;public: ///Creates an exception /** @param info A string specifying details of the error. */ Exception(const char *info); ///Creates an exception /** @param info A string specifying details of the error. */ Exception(std::string info); ///Returns a string consisting of the details specified when the Exception was created std::string what() const { return details; }protected: void *operator new(uint size); //not defined};}; //namespace annie#endif // define _EXCEPTION_H
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?