I'm not sure, if I something misunderstand, but I'm woriing about security making only one instace of singleton. (I have readed Modern programing in c++)
I can make a any number of them:
friend class Loki::CreateUsingNew<ExperimentClass>;
typedef Loki::SingletonHolder<ExperimentClass, Loki::CreateUsingNew> ExperimentClassSingleton;
ExperimentClass &instance1 = ExperimentClassSingleton::Instance();
ExperimentClass *instance2 = Loki::CreateUsingNew<ExperimentClass>::Create();
I'm sorry, I send it to "OpenDiscussion", not "Developers". Can I or Admin move it to the right place?
No way to handle your question if you add some friend classes or functions into your own classes.
But you told me there was no perfect solution,Loki just helped close to our goals.
- If I will not add friend, Loki's singleton holder will not be able to create any instance, if I understand it correctly, so I have to.
- I see. Ok ;).
Thanks for answer and sorry for late reply, it looks like I failed to set up monitoring this thread correctly.
Log in to post a comment.