Changes between Initial Version and Version 2 of Ticket #13163
- Timestamp:
- Aug 22, 2017, 9:02:35 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #13163
- Property Owner set to
- Property Status new → assigned
- Property Component None → thread
-
Ticket #13163 – Description
initial v2 1 1 Locally, we had code that previously built in CentOS 6.x, using a compiler circa from 2009 that does not support variadic templates / rvalue references: 2 2 3 4 {{{ 3 5 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) 4 6 Copyright (C) 2010 Free Software Foundation, Inc. 5 7 This is free software; see the source for copying conditions. There is NO 6 8 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 }}} 10 7 11 8 12 Without variadic templates / rvalue references boost provides a boost::thread's variable argument constructor that supports up to 9 arguments + thread main. Sadly, the variadic implementation that is enabled when rvalue references + variadic arguments are supported is: 13 14 {{{ 9 15 template<typename F, class ...ArgTypes> 10 16 static inline detail::thread_data_ptr make_thread_info(BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_RV_REF(ArgTypes)... args) … … 17 23 ); 18 24 } 25 }}} 26 19 27 20 28 In turn, this calls into the platform specific version of heap_new, which currently only supports up to a total of 4 arguments. Locally, I have modified my boost version (e.g. boost/thread/pthread/thread_heap_alloc.hpp) to have this definition: 21 29 30 31 {{{ 22 32 #if defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD) 23 33 template<typename T,typename... Args> … … 29 39 ... 30 40 41 }}} 42 31 43 While this is functional for my needs, obviously I think it (or something like it) should get into boost proper. Moreover, not that it likely matters, but it would also be wise to support at least 10 arguments to heap_new, in the non-variadic variant, so that it supports the ubiquity of other use cases in boost::thread et al. 32 44