私は次のようにテンプレートパラメータを使用して stl マップを宣言しようとしています:( T を typename と仮定しますtemplate <class T>:)
map<T, T> m;(.h ファイル内)
それはうまくコンパイルされます。現在、私のcppファイルでは、マップに挿入したいときにできません。私がインテリセンスで取得する唯一のメソッドは、「at」メソッドと「swap」メソッドです。
何か案は?どなたかお願いします。
前もって感謝します。
サンプルコードは次のとおりです。
#pragma once
#include <iostream>
#include <map>
using namespace std;
template <class T> 
class MySample  
{  
map<T, T> myMap;
//other details omitted
public:
//constructor 
MySample(T t)
{
    //here I am not able to use any map methods. 
    //for example i want to insert some elements into the map
    //but the only methods I can see with Visual Studio intellisense
    //are the "at" and "swap" and two other operators
    //Why???
    myMap.  
}
//destructor
~MySample(void)
{
}
//other details omitted
};