F
Fei Liu
#include <vector>
#include <iostream>
template <template <typename T, typename Alloc> class C>
struct A{
//C<T> c;
//A(){ c[0]=10; }
void print(){ std::cout << "A" << std::endl; }
};
int main(){
A<std::vector> a;
a.print();
}
This posted code seems the only valid way of using template template
argument in this context. I've tried a few combinations of rearranging
things but they all failed the compiler. I am wondering what's the
point of a A<std::vector> a? It really cannot contain anything, can it?
Thanks,
#include <iostream>
template <template <typename T, typename Alloc> class C>
struct A{
//C<T> c;
//A(){ c[0]=10; }
void print(){ std::cout << "A" << std::endl; }
};
int main(){
A<std::vector> a;
a.print();
}
This posted code seems the only valid way of using template template
argument in this context. I've tried a few combinations of rearranging
things but they all failed the compiler. I am wondering what's the
point of a A<std::vector> a? It really cannot contain anything, can it?
Thanks,