Fix crappy template
This commit is contained in:
parent
b39bbeb8dc
commit
a335828778
@ -69,11 +69,12 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template<typename T, typename ...Argts>
|
template<typename T>
|
||||||
class Worker : public QThread {
|
class Worker : public QThread {
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<IPrintable> printer_;
|
std::unique_ptr<IPrintable> printer_;
|
||||||
public:
|
public:
|
||||||
|
template<typename ...Argts>
|
||||||
Worker(QString tname, Argts &... args) : printer_(std::make_unique<T>(args...)) {};
|
Worker(QString tname, Argts &... args) : printer_(std::make_unique<T>(args...)) {};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -93,9 +94,9 @@ int main(int argc, char *argv[]) {
|
|||||||
QSemaphore lockC(1);
|
QSemaphore lockC(1);
|
||||||
QSemaphore lockBC(0);
|
QSemaphore lockBC(0);
|
||||||
|
|
||||||
Worker<PrintA, QSemaphore> t1("Thread 1", lockBC);
|
Worker<PrintA> t1("Thread 1", lockBC);
|
||||||
Worker<PrintB, QSemaphore, QSemaphore> t2("Thread 1", lockBC, lockC);
|
Worker<PrintB> t2("Thread 1", lockBC, lockC);
|
||||||
Worker<PrintC, QSemaphore, QSemaphore> t3("Thread 1", lockBC, lockC);
|
Worker<PrintC> t3("Thread 1", lockBC, lockC);
|
||||||
|
|
||||||
t1.start();
|
t1.start();
|
||||||
t2.start();
|
t2.start();
|
||||||
|
Loading…
Reference in New Issue
Block a user