1

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
            {
                   ...
            }

};
4

1 回答 1

2

它编译得很好。所有你需要做的是:定义TSet之后sortIndices

自己看这个:http
://www.ideone.com/VxBrh 使用示例::Typehttp ://www.ideone.com/uRWur

于 2011-01-29T22:01:23.287 回答