Why am I getting 'missing template arguments before f'

c++, c++11

Solution

You have to use

int main()
{
  Fun<> f {"a", "b", "c"};
}

Because Fun is a template.

It's like if you called "function" instead of "function()" by the fact of not having parameters.

You could say that "you are instantiating a template class so it returns a class".

Problem

I have simple code where I am getting to drive from `std::vector<std::string>>` but it's not working. I am getting the error: prog.cpp: In function `‘int main()’`: prog.cpp:14:9: error: missing template arguments before `‘f’` `Fun f {"a", "b", "c"};` ^ prog.cpp:14:9: error: expected `‘;’` before `‘f’` Here is the code. Can anyone tell me what I did wrong? ``` #include <string> #include <vector> template< class String = std::string, class List = std::vector<String> > class Fun : public List { }; int main() { Fun f {"a", "b", "c"}; } ```

Original source