07/10/18 12:38:16
VC2005 Proを使ってます。
クラスライブラリのヘッダにて、abstract sealedの
クラス内にtypedefとtemplateを使った定義をしました。
しかし、そのヘッダ内では使えるものの、そのほかのクラスでは使用
できません。コンパイルエラーになります(定義されていないとのこと)
(staticのメンバ関数などはOK)。
どうしたら、他クラスで使用できるのでしょうか?また、templateや
typedefをクラスライブラリで定義する場合はこの方法しかないのでしょうか?
// typedefを使用したクラス(例)
public ref class TYPES abstract sealed{
public:
typedef short test16;
typedef unsigned short utest16;};
// templateを使用したクラス(例)
public ref class METHODS abstract sealed{
public:
template <typename T1>
static T1 TEMPTEST (const T1& t1)
{return t1;}
// このメンバ関数は他クラスでも使用可能
static void TEST(int num){int i = 3;}
};