Boost logo

Boost Users :

Subject: Re: [Boost-users] Weird code in lockfree::queue::reserve (compilation error)
From: Bjorn Reese (breese_at_[hidden])
Date: 2016-04-02 17:50:19


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net