void thread_func(Color& r)
{
//
}
void f()
{
Color r(red_state);
thread t(thread_func, r);
t.join();
}
Simplified. I can't find anything online that matches this specific case (class object passed into non-member thread function). I've tried a few suggestions (adding '&', std::ref(r), using vectors, etc.), but I keep getting the following errors:
error: no type named 'type' in 'class std::result_of<void (*(Color*))(Color&)>'
error: use of deleted function 'Color::Color(const Color&)'
The latter makes me think it has something to do with the copy constructor, but I figured passing it in by reference shouldn't affect that? Any tips or feedback would be greatly appreciated.