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

📄 registrar.cpp

📁 压缩包里有教材<<C++模式设计-基于QT4开源跨平台开发框架>>所有源码
💻 CPP
字号:
/*  Selected implementation examples    This file is not complete! */#include "registrar.h"namespace Registrar_Namespace {    long Student::nextNumber() { /* Without the above using declaration,         this would be "long Registrar_Namespace::Student::nextNumber" */         static long number = 1000000;         return ++number;    }    Registrar& Registrar::instance() { /* Implementation of        Singleton factory method: this is the only way         clients can create instances of this Registrar. */                static Registrar onlyInstance;        return onlyInstance;    }    Exception::Exception(const QString& reason)         : m_Reason(reason) {}        QString Exception::what() const {        return m_Reason;    }        NoNumberException::NoNumberException(const QString& reason)         : Exception(reason) {}        NoStudentException::NoStudentException(const QString& reason)         : Exception(reason) {}        DupNumberException::DupNumberException(const QString& reason)         : Exception(reason) {}}

⌨️ 快捷键说明

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