次のクラス宣言があります。
template <typename Key_T, typename Mapped_T, size_t MaxLevel = 5>
class SkipList
{
public:
class Iterator
{
typedef std::pair<Key_T, Mapped_T> ValueType;
template <typename Key1, typename Obj1, size_t MaxLevel1> friend class SkipList;
public:
//Iterator functions
private:
//Iterator Data
};
SkipList();
~SkipList();
SkipList(const SkipList &);
SkipList &operator=(const SkipList &);
std::pair<Iterator, bool> insert(const ValueType &);
template <typename IT_T>
void insert(IT_T range_beg, IT_T range_end);
void erase(Iterator pos);
private:
//data
};
SkipList
insert
クラス定義の外で関数を宣言しているとき
template <typename Key_T, typename Mapped_T, size_t MaxLevel>
typename std::pair<SkipList<Key_T,Mapped_T,MaxLevel>::Iterator, bool> SkipList<Key_T,Mapped_T,MaxLevel>::insert(const ValueType &input)
次のエラーが発生します。
SkipList.cpp:349:69: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
SkipList.cpp:349:69: error: expected a type, got ‘SkipList<Key_T, Mapped_T, MaxLevel>::Iterator’
SkipList.cpp:349:72: error: ‘SkipList’ in namespace ‘std’ does not name a type
SkipList.cpp:349:80: error: expected unqualified-id before ‘<’ token
コードの何が問題になっていますか?