【发布时间】:2021-03-02 21:35:48
【问题描述】:
从“The C++ Programming Language 4th edition”(第1215页)的这段代码sn-p,我不明白“using”的用法;这些方法没有被派生类覆盖;为什么不直接从线程的正常继承中使用这两种方法呢?
struct guarded_thread : thread {
using thread::thread;
using thread::operator=;
~guarded_thread() { if (joinable()) join(); }
}
【问题讨论】:
标签: c++ class inheritance using base