identif.h

来自「Design Componenet With C++ STL配套书源代码」· C头文件 代码 · 共 26 行

H
26
字号
// k2/identify/identif.h#ifndef IDENTIF_H#define IDENTIF_H#include<iostream>#include<string>class Identifier {  public:   const std::string& toString() const { return theIdentifier;}   friend std::istream& operator>>(std::istream&, Identifier&);  private:   std::string theIdentifier;};inline bool operator==(const Identifier& N1, const Identifier& N2) {    return N1.toString() == N2.toString();}inline bool operator<(const Identifier& N1, const Identifier& N2) {    return N1.toString() < N2.toString();}std::ostream& operator<<(std::ostream&, const Identifier&);#endif

⌨️ 快捷键说明

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