私は C++ テンプレートに不慣れで、いくつかのコンパイラの苦情に非常に苦労しています。テンプレート クラスでクラス スコープ型を定義しており、この型を別の場所から参照したいと考えています。タイプの名前を修飾するためにさまざまな方法を試しましたが、達成できる唯一のことは、さまざまなエラーメッセージを取得することです。
mylist.h古典的なリストの実装であるでの私のクラスの定義は次のとおりです。
template<typename T> class MyList {
public:
    class ListElement; // forward declaration
    typedef ListElement* LPOS;  // the problematic typedef
    // helper class for list elements
    class ListElement {
        LPOS next;
        int content;
      public:
        ListElement(T);
        LPOS getNext();
        ... 
    };
    // the list itself
    MyList();
    ListElement* first;
    LPOS add(T);
    LPOS insert(T, LPOS);
    ... // more list functions
};
ここで、LPOS タイプを外部から使用したいと考えていますmain.cpp。
include "mylist.h"
...
void testList (void) {
    LPOS pos;                // compiler error: expected ';' before pos
    MyList<T>::LPOS pos; // compiler error: expected initializer before pos
    MyList::LPOS pos;    // compiler error: expected ';' before pos
「使用する」を使用しようとしましたが、それもどこにもつながりませんでした。どんな助けでも大歓迎です。