私はオブジェクトを持っています。HIDDevice
は、それ自体が静的であるstd::map
を維持しています。以下に示すようにしかし、コンパイル・エラーが発生した結果、以下のクラスは、コンストラクタとデストラクタをプライベート行われたときに次のようにプライベートコンストラクタとそれ自身の静的コンテナ(マップ)を持つオブジェクト?
class HIDDevice
{
public:
static HIDDevice* getDevice(unsigned short vendorID, unsigned short productID);
int writeData(const unsigned char *data, int length);
int readData(unsigned char *data, int length);
private:
static std::map<std::string, HIDDevice> m_hidDevices;
static bool isInitialized;
static void initHIDAPI();
HIDDevice(){};
HIDDevice(unsigned short vendorID, unsigned short productID, std::string serialNumber = "");
HIDDevice(std::string path);
~HIDDevice();
};
EDIT
エラーメッセージは以下のとおりです。
error C2248: 'HIDDevice::HIDDevice' : cannot access private member declared in class 'HIDDevice'
エラーは何ですか? – P0W
あなたは[mcve]を投稿する必要があります。あなたのエラーは非常に明白で、かなり共通しているように見えますが、[mcve]なしでは確認できません。 –
この[URL](http://stackoverflow.com/help)をチェックしてコンテンツの品質を上げると便利です –