📄 student_info.h
字号:
#ifndef GUARD_Student_info
#define GUARD_Student_info
#include <iostream>
#include <string>
#include "Core.h"
#include "Handle.h"
class Student_info {
public:
Student_info() { }
Student_info(std::istream& is) { read(is); }
// no copy, assign, or destructor: they're no longer needed
std::istream& read(std::istream&);
std::string name() const {
if (cp) return cp->name();
else throw std::runtime_error("uninitialized Student");
}
double grade() const {
if (cp) return cp->grade();
else throw std::runtime_error("uninitialized Student");
}
static bool compare(const Student_info& s1,
const Student_info& s2) {
return s1.name() < s2.name();
}
private:
Handle<Core> cp;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -