smart-pointers
How to overload operator ->* in C++
Is there a way to overload ->* for use with a smart-pointer-like object?Below is what I would like to do.For simplicity I\'m not using templates (I\'ll get to that once I have it working for a sing[详细]
2023-02-19 09:31 分类:问答Please explain this expression
class TestPtr : protected QSharedPointer<Test> where Test is an abstract interface class. The TestPtr class should serve as the sma开发者_如何学Crt pointer class.[详细]
2023-02-17 14:18 分类:问答"Template typedef" inside a copy constructor doesn't work
Some background: I\'m writing a policy-based smart pointer (like SmartPtr in the Loki library), which can have destructive copy semantics like auto_ptr. Therefore, it needs to have a template copy con[详细]
2023-02-17 12:30 分类:问答shared_ptr - pass by value vs pass by reference
Suppose I have: typedef boost::shared_ptr<Event> EventPtr; On one thread, I am creating an Event and sending it off to get dispatched:[详细]
2023-02-17 10:41 分类:问答A new generic pointer any_ptr (now dumb_ptr) to make code more reusable among smart pointers
I have been using a lot of different boost smart pointers lately, as well as normal pointers. I have noticed that as you develop you tend to realise that you have to switch pointer types开发者_Python百[详细]
2023-02-16 23:49 分类:问答Casting boost::shared_array<void> to boost::shared_array<int>
I have some legacy code that looks like this: void* getData(D开发者_开发技巧ataTypedataType) { switch(dataType)[详细]
2023-02-15 07:54 分类:问答Accelerated C++: Can I substitute raw pointers for smart pointers?
I love this book, sadly it does not cover smart pointers as they were not part 开发者_Go百科of the standard back then. So when reading the book can I fairly substitute every mentioned pointer by a sma[详细]
2023-02-12 17:00 分类:问答Can someone explain smart pointers in plain English?
Today I was asked about smart pointers in C++, and I can\'t find anywhere useful information about it..[详细]
2023-02-10 09:26 分类:问答my own smart pointer template compilation error
I am having following simple program from scott meyers book. I am compiling using Visual studio 2009.[详细]
2023-02-09 22:57 分类:问答Pimpl with smart pointers in a class with a template constructor: weird incomplete type issue
When using smart pointers with the pImpl idiom, as in struct Foo { private: struct Impl; boost::scoped_ptr<Impl> pImpl;[详细]
2023-02-09 14:52 分类:问答