Namespaces
Variants
Views
Actions

Talk:cpp/container/vector/deduction guides

From cppreference.com
< Talk:cpp‎ | container‎ | vector
Revision as of 02:16, 1 September 2017 by T. Canens (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

std:: prefix missing?

In the code snippet,

 template< class InputIt,
           class Alloc = std::allocator<typename std::iterator_traits<InputIt>::value_type>>
 vector(InputIt, InputIt, Alloc = Alloc())
   -> vector<typename std::iterator_traits<InputIt>::value_type, Alloc>;

should it read std::vector instead of vector? Since std::allocator and std::iterator_traits are namespace qualified, I guess vector should be too. Or is there something about the deduction guide syntax that means it is not necessary?

62.119.248.38 00:07, 1 September 2017 (PDT)

The grammar doesn't permit qualification at those locations. T. Canens (talk) 03:16, 1 September 2017 (PDT)