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

2009-02-13 Thread ZaeX
When the Singleton class is linked, the DLL will get the Singleton::_instance as an unique static variable. Well, In my last attempt, it appeared to be like that. On Fri, Feb 13, 2009 at 5:33 PM, John Reid wrote: > ZaeX wrote: > >> And in my opinion, you'd better be careful if you expect that th

[C++-sig] Returning PyObject and return_internal_reference<>

2009-02-13 Thread Václav Haisman
Hi, I am trying to return a new Python buffer that is a view to internals of my Message object. My understanding is that in such case, I should use return_internal_reference<> to make the return value hold reference to the Message class because of this bit of PyBuffer_FromMemory() docs: "The caller

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

2009-02-13 Thread John Reid
ZaeX wrote: 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 side. I don't think this is