0
은이 질문은 부분적으로 여기"typedef void (* task)()"는 무엇을합니까?
What does "typedef void (*Something)()" mean 대답하지만 대답은 나에게 완전히 명확하지 않다. 내가
이 이typedef void (*task)();
이 어떻게 확장 않는 작성하는 경우
?
thread_pool(unsigned int num_threads, task tbd) {
for(int i = 0; i < num_threads; ++i) {
the_pool.push_back(thread(tbd));
}
}
thread_pool(unsigned int num_threads, (*task)() tbd) {
for(int i = 0; i < num_threads; ++i) {
the_pool.push_back(thread(tbd));
}
}
아마도 구문 오류이므로 가능하지 않습니다. 네가 나를 위해 일을 정리해주기를 바란다. http://www.thesaguaros.com/openmp-style-constructs-in-c11.html
감사합니다. 이제는 의미가 있습니다. –