0

I need to init std::thread with templates.

class Loader { template <class T, class ...TArgs> static void work(T t, TArgs ...args) { //do stuff } template <class T, class ...TArgs> static void Load(T t, TArgs ...args) { thread thr = thread(Loader::work,t,args...); thr.join() } } 

I tied that on my custom classes initialization and its worked, but i dont know what should i do with threads.

Thanks for any advice

1 Answer 1

2

You need to explicitly specify types used in a template:

thread thr = thread(Loader::work<T, TArgs...>,t,args...); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.