Re: [Boost-users] Weird code in lockfree::queue::reserve (compilation error)
On 04/02/2016 05:08 PM, Aurelien Regat-Barrel wrote:
I'm trying to use lockfree::queue, and I get a compiler error when calling reserve(). The following code does not compile with VC++ 2015:
What error are you getting? Have you checked that the type T you use as the template argument to lockfree::queue<T> fulfills the documented requirements?
void reserve(size_type n) { pool.template reserve<true>(n); }
And indeed... what does this syntax mean: "pool.template reserve"? You can see it here:
The use of the template keyword above is correct. It is used to help the C++ compiler resolve an otherwise ambiguous syntax. See the section "The template disambiguator for dependent names" at: http://en.cppreference.com/w/cpp/language/dependent_name
Hello,
What error are you getting?
VC++ 2015 emits a syntax error:
void f() {
boost::lockfree::queue
participants (2)
-
Aurelien Regat-Barrel
-
Bjorn Reese