SharedSchoolSpace/作业/数据结构-金健/C++/第三章作业/test/test_view.cpp

31 lines
819 B
C++
Raw Normal View History

2023-10-29 11:17:01 +08:00
// @Time : 2023-10-24 19:10:31
// @FileName: test_view.cpp
// @Author : 423A35C7
// @Software: VSCode
#include <bits/stdc++.h>
#include "view.hpp"
using namespace std;
template <typename T>
class TestModel : public vector<T> {
public:
using vector<T>::vector; // 这样好像可以继承构造函数
int_ get_length() {
return this->size();
}
};
int main() {
TestModel<int> a {1, 2, 3, 4, 5};
auto background_view = BackgroundView(DEFAULT_GATE_X, DEFAULT_GATE_Y);
auto queue_view = SimpleQueueView<int, TestModel<int>>(a, 10, 10);
// queue_view.init();
queue_view.refresh();
TestModel<int> b {10, 20, 30, 40, 50};
auto queue_view2 = SimpleQueueView<int, TestModel<int>>(b, 20, 50);
// queue_view2.init();
queue_view2.refresh();
return 0;
}