与此问题类似:Start thread with member function和此问题:std::thread calling method of class
但是我有以下内容:
let symbols = req.query.symbols;
let queries = [];
for(let symbol of symbols){
let query = db.Symbol.findOne({
where: {
symbol
},
attributes: ["symbol"],
include: [{
as: "price",
model: db.Price
}],
order: [
[{ as: "price", model: db.Price }, "createdAt", "DESC"]
]
});
queries.push(query);
}
let values = await Promise.all(queries);
然后我必须从新线程中的另一个地方调用#include <thread>
#include <iostream>
class myAbstractClass {
public:
virtual void myFunction() = 0;//abstract class
}
class myFirstClass : public myAbstractClass {
public:
void myFunction() { std::cout << "First class here";}
}
class mySecondClass : public myAbstractClass {
public:
void myFunction() { std::cout << "Second class here";}
}
,但以下内容不能编译(我想不出其他任何事情要尝试):
myFunction()