no matching function error using template template parameters in a function

后端 未结 1 1985

I\'m trying to define a function using template template parameters (I just want to know how it works). I have the following:

template 

        
1条回答
  •  清酒与你
    2021-01-24 20:30

    What you have is a non-deduced context, aswell as a template template parameter mismatch even if the context was deducible. std::vector takes a second template parameter, the allocator, that is defaulted to std::allocator.

    For the non-deduced context, T can never be deduced and will always have to be specified, the typename indicates this. See this question for the gory details.

    0 讨论(0)
提交回复
热议问题