使用模板类自定义数组 并用此数组类存放Date类

#include<iostream>
#include<assert.h>
using namespace std;

//使用模板类自定义数组 并用此数组类存放Date类
template<class T,int len>
class Array
{
private:
    T arr[len];
public:
    T& operator[](int sub)
    {
        assert(sub < len && sub >= 0);
        return arr[sub];
    }
};

class Date
{
private:
    int m_year;
    int m_month;
    int m_day;
public:
    Date(int y = 0, int m = 0, int d = 0)
    {
        m_year = y;
        m_month = m;
        m_day = d;
    }
};

int main()
{
    Array<Date, 2> arr1;
    Date d1(2020, 11, 11);
    Date d2(2070, 12, 21);
    arr1[0] = d1;
    arr1[1] = d2;
    return 0;
}