Re: [C++-sig] Call Policy for Singleton

2009-02-12 Thread ZaeX
I think reference_existing_object will work. And in my opinion, you'd better be careful if you expect that the c++ code and python code are using the same singleton instance. Because there're two Singleton::_instance if you export the Singleton class to Python. one at c++ side, the other at python

[C++-sig] Call Policy for Singleton

2009-02-12 Thread Balasubramanyam, Shivakumar
HI, The am not sure if which call policy I should be using for this particular use case, class Singleton { public: Singleton* create() { if(!_instance) { _instance = new Singleton(); } return _instance; } static Singleton* _instance; }