[thread] attribute constructor failing to compile
Hey hey,
using boost 1.78 from the Archlinux repository, using the thread constructor
with
boost::thread::attributes
as first argument fails to compile.
The relevant code from the small test program is this:
void work(bool& done)
// simple main function for the thread
int main()
{
bool done = false;
boost::thread::attributes attr;
// all changes commented out in the program
boost::thread th1(attr, work, std::ref(done));
// some code, sleep and set done to true
th1.join();
return 0;
}
g++ 11.2.0 reports the following error:
In file included from /usr/include/boost/thread/detail/thread.hpp:33,
from /usr/include/boost/thread/thread_only.hpp:22,
from /usr/include/boost/thread/thread.hpp:12,
from thread_prio.cpp:1:
/usr/include/boost/bind/bind.hpp: In instantiation of 'void boost::_bi::list2
On Sat, May 21, 2022 at 2:51 PM Jeanette C. wrote:
Hey hey, using boost 1.78 from the Archlinux repository, using the thread constructor with boost::thread::attributes as first argument fails to compile.
It's as if BOOST_THREAD_PROVIDES_VARIADIC_THREAD is not defined, which would happen if BOOST_THREAD_VERSION is less than 4. Can you check if this is the case? Glen
It's as if BOOST_THREAD_PROVIDES_VARIADIC_THREAD is not defined, which would happen if BOOST_THREAD_VERSION is less than 4. Can you check if this is the case? ...
May 21 2022, Glen Fernandes has written: ... the version is 2, although the include files mention versions upto 5. What is the recommended way to set this, please? Best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * Audiobombs: https://www.audiobombs.com/users/jeanette_c * GitHub: https://github.com/jeanette-c Don't care about money It doesn't give me half the thrill <3 (Britney Spears)
It looks like the overload taking thread::attributes as parameter does not accept variadic arguments: ``` template<typename Callable> thread(attributes& attrs, Callable func); ``` https://www.boost.org/doc/libs/1_79_0/doc/html/thread/thread_management.html... On Sat, May 21, 2022 at 6:18 PM Jeanette C. via Boost-users < boost-users@lists.boost.org> wrote:
It's as if BOOST_THREAD_PROVIDES_VARIADIC_THREAD is not defined, which would happen if BOOST_THREAD_VERSION is less than 4. Can you check if this is the case? ...
May 21 2022, Glen Fernandes has written: ... the version is 2, although the include files mention versions upto 5. What is the recommended way to set this, please?
Best wishes,
Jeanette
-- * Website: http://juliencoder.de - for summer is a state of sound * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * Audiobombs: https://www.audiobombs.com/users/jeanette_c * GitHub: https://github.com/jeanette-c
Don't care about money It doesn't give me half the thrill <3 (Britney Spears) _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Juan :wq
participants (3)
-
Glen Fernandes
-
Jeanette C.
-
Juan Ramírez