On 02/24/2012 09:33 AM, Holger Joukl wrote: > bp::object itself has reference (smart pointer) semantics, so there is > no need to pass objects by reference. > I see. Just out of curiosity: > If I pass by reference I do save a copy constructor call, don't I?
In principle, yes. I'm not sure how much of this the compiler would be able to optimize away, though. > But I circumvent the bp::object refcount safety, though(?). Well, yes, but you don't need that as C++ language semantics ensure the object lifetime. > But in a type check like above this shouldn't be dangerous - right? There is definitely no danger in doing this. It may just add a little bit of overhead (since in certain cases passing by value is cheaper than passing by reference, depending on the involved types and optimization level. Stefan -- ...ich hab' noch einen Koffer in Berlin... _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig