//// Created by wangyz38535 on 2024年8月28日.//#include <iostream>#include <queue>#include <thread>#include <mutex>#include <condition_variable>#include <chrono>#include <cassert>#include <string>#include <vector>#include <mutex>#include <fstream>// 基类模板template <typename T>class Base {public:T value;void display() {std::cout << "Base value: " << value << std::endl;}};// 派生类模板template <typename U>class Derived : public Base<U> {public:Derived(U v) {// 使用 this-> 来访问基类模板中的成员this->value = v;}void show() {// 使用 this-> 来访问基类的成员函数this->display();}};// 显式基类资格修饰符方法template <typename U>class DerivedExplicit : public Base<U> {public:DerivedExplicit(U v) {// 使用基类资格修饰符来访问成员Base<U>::value = v;}void show() {// 使用基类资格修饰符来访问成员函数Base<U>::display();}};// 对数组进行排序int main() {int i = 12;int d = i ++;std::cout << d << std::endl;return 0;}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。