⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 errorcorrelator.cpp

📁 C++高级编程这本书所附的源代码
💻 CPP
字号:
#include "ErrorCorrelator.h"using namespace std;bool operator<(const Error& lhs, const Error& rhs){  return (lhs.mPriority < rhs.mPriority);}ostream& operator<<(ostream& str, const Error& err){  str << err.mError << " (priority " << err.mPriority << ")";  return (str);}void ErrorCorrelator::addError(const Error& error){  mErrors.push(error);}Error ErrorCorrelator::getError() throw (out_of_range){  //  // If there are no more errors, throw an exception.  //  if (mErrors.empty()) {    throw (out_of_range("No elements!"));  }    // Save the top element  Error top = mErrors.top();  // Remove the top element.  mErrors.pop();  // Return the saved element.  return (top);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -