📄 record.h
字号:
template <class K>
class Record
{ friend bool operator==(const Record &x, const Record &y) {return x.key==y.key; }
friend bool operator<(const Record &x, const Record &y) { return x.key<y.key; }
friend bool operator>(const Record &x, const Record &y) { return x.key>y.key; }
friend bool operator>=(const Record &x, const Record &y) { return x.key>=y.key; }
friend bool operator<=(const Record &x, const Record &y) { return x.key<=y.key; }
friend bool operator!=(const Record &x, const Record &y) { return x.key!=y.key; }
// friend ostream &operator<<(ostream& out,Record<K> &x)
// { return out<<x.key<<' '; }
public:
Record():key(-999){}
Record(K k):key(k){}
Record(const Record& copy)
{ key=copy.key; other=copy.other; }
Record& operator=(const Record& copy)
{ key=copy.key; other=copy.other; return *this; }
K Getkey(){ return key; }
private:
K key;
char *other;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -