1

このコードのどこが間違っていますか?

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

それはうまくコンパイルされます。あなたがする必要があるのはこれだけです:定義TSetsortIndices

これを自分で参照してください: http://www.ideone.com/VxBrh
使用例::Type : http://www.ideone.com/uRWur

于 2011-01-29T22:01:23.287 に答える