tis代码有什么问题?
template <typename T, template <typename> class GList>
struct TSet
{
typedef std::set <unsigned int, sortIndices <T, GList> > Type; //Error, too many template arguments
};
template <typename T, template <typename> class GList>
class sortIndices
{
private:
const GList <T> *l;
public:
sortIndices ( const GList <T> *l_ ) : l ( l_ ) {}
bool operator() ( const unsigned int &i_p1, const unsigned int &i_p2 ) const
{
...
}
};
答案 0 :(得分:2)
编译好。您需要做的就是:在TSet
之后定义sortIndices
。
亲自看到:http://www.ideone.com/VxBrh
使用::Type
的示例:http://www.ideone.com/uRWur