You're trying to partially specialise a (member) function template. Function templates cannot be partially specialised in C++. You'd have to partially specialise the entire class, or find other ways of doing what you want. For example, you could use a trait in Top()
:
I* Top()
{
return MyQueueTraits<I, C>::GetTop(items);
}
template <class I, class C>
struct MyQueueTraits
{
static I* GetTop(C &c) { return &c.front(); }
};
template <class I>
struct MyQueueTraits<I, std::priority_queue<I>>
{
static I* GetTop(std::pirority_queue<I> &c) { return &c.top(); }
};