C++ C++;对象日期,但仅用int调用?

C++ C++;对象日期,但仅用int调用?,c++,C++,我有个上课的约会。该类有4个私有变量(天、小时、分钟、秒)和所有运算符重载 基本上,我想做的是: map<Date, int> agenda; 而不是: Ressource::Ressource(int qtemin_, int qtemax_, int init_) : qtemin(qtemin_), qtemax(qtemax_) { // agenda[0] = agenda[2147483647] = init_; agenda[Date(0,0,0)] = agenda

我有个上课的约会。该类有4个私有变量(天、小时、分钟、秒)和所有运算符重载

基本上,我想做的是:

map<Date, int> agenda;
而不是:

Ressource::Ressource(int qtemin_, int qtemax_, int init_) : qtemin(qtemin_), qtemax(qtemax_) {
// agenda[0] = agenda[2147483647] = init_;
agenda[Date(0,0,0)] = agenda[Date(9999,99,99] = init_;
}
这将是我的主要目标。我知道这是可能的,因为我看到有人这样做,但我没有访问date.h和date.cpp


注释中的数字是最大整数大小。(我基本上想做一个时间轴并初始化两个极端。)

在类中定义一些返回感兴趣的值的静态成员怎么样

class Date {
   // ...
    public static Date last() {
       return Date(9999,99,99);
    }
   // ...
}
“***不知何故,我无法在stackoverflow*中键入<>只需查看编辑器帮助中的代码格式设置,您可以在四个空格前键入此类代码。请查看并描述您遇到的问题。我不清楚你给出的代码是什么。我们还可以方便地将您的工作发布到编译器中,并在返回给您之前尝试解决方案。我们不能用你的一句台词。我只能猜里面有什么日期。
class Date {
   // ...
    public static Date last() {
       return Date(9999,99,99);
    }
   // ...
}