class Test
{
public:
typedef std::map<double, double> MapType;
private:
MapType myMap;
public:
...
const MapType& getMap() const // is this normal????
{
return myMap;
}
};
クラス Test の外で Map を使用したいのですが、参照を返すことはできますか?それとも悪いケースがありますか?