Closed gchenfc closed 2 years ago
I'm familiar with the @, *, and &, but where are you proposing to use the pointer? (btw, I think you maybe meant "at" symbol, ampersand is normal reference right?)
This is a const-reference to a boost::shared pointer of a const - so I'm not sure how to make this cleaner?
We can delete the const ref - I guess the const ref saves one counter increment/decrement that won't (?) get compiler optimized, but I doubt that makes much of a difference.
KISS? in a .i files the symbol `` already means “shared pointer”. Usage in python should be:
p = Params(…)
Some_functionthat_takes_shared_pointer(p)
and in .i file:
class Params{ …};
void Some_functionthat_takes_shared_pointer(Params* p);
and clean up ref/const in c++ to match:
void Some_functionthat_takes_shared_pointer(const boost::shared_ptr<Params>& p);
Wow thanks I'm stupid, I don't know why I thought that wouldn't work but in retrospect it should have been obvious. Thanks all!
Yeah my comment wasn't super clear. Glad you managed to figure it out.
Title self-explanatory.
With @nrakoski3