Original Post
🔒 Locked
c++ Struct Question
Advertisement
Yes, it's possible.
There's a very high probability that doing this is useless (i.e. you don't need the protection), and a high probability that your design will cause you great pain in a few weeks or months.
struct TheStruct{ static TheStruct & Instance() { static TheStruct instance; return instance; }private: TheStruct(); TheStruct(const TheStruct &);};There's a very high probability that doing this is useless (i.e. you don't need the protection), and a high probability that your design will cause you great pain in a few weeks or months.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement