queue template constructors uncallable
- Dominant language
- C++
- Stars
- 160
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
Using queue with an allocator, it is impossible to write code that invokes this template constructor:
```
template
queue(size_type n, typename node_allocator::template rebind::other const & alloc):
```
(or the other one with the rebind).
The template argument U cannot be deduced (at least with gcc 5.3.0).
I had to add the following form in order to use this with a custom allocator:
`explicit queue(size_type n, allocator const & alloc)`
I notice that the constructor that takes only an `alloc` already has this overload.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the queue constructor overloads shown in the issue and compare them with the existing constructor that accepts only an allocator. Verify that constructing a queue with a size and custom allocator compiles without requiring an undeducible template argument; completion is demonstrated by a compiling regression test or equivalent build check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100