Why is allocator::rebind necessary when we have template template parameters?

A quoted text from Foundations of Algorithms in C++11, Volume 1, chap 4, p. 35 : template <typename T> struct allocator { template <typename U> using rebind = allocator<U>; }; sample usage : allocator<int>::rebind<char> x; In The C++ Programming Language, 4th edition, section 34.4.1, p. 998, commenting the ‘classical’ rebind member in default allocator class … Read more

C++ variadic template template argument that matches any kind of parameters

Your interesting construct has two levels with variadic templates. An outer variadic template parameter list TemplateP & Sizes for a function template An inner parameter pack as the template parameters of your template template parameter TemplateT, a class template First, let’s look at the inner TemplateT class: why can the ellipsis operator not not match … Read more

Variadic template templates and perfect forwarding

That’s exactly right. I would expect it to work. So I think that GCC is in error with rejecting that. FWIW: #include <utility> template <template <typename…> class TemplateClass, typename… Args> TemplateClass<Args…> make(Args&&… args) { return TemplateClass<Args…>(std::forward<Args>(args)…); } int main() { make<std::pair>(1, 2); } // [js@HOST2 cpp]$ clang++ -std=c++0x main1.cpp // [js@HOST2 cpp]$