I have a pet project with which I experiment with new features of C++11. While I have experience with C, I\'m fairly new to C++. To train myself into best practices, (besides reading a lot), I have en
I\'m having trouble getting intellisense to auto-complete shared pointers for boost 1.40.0.(It works fine for Boost 1.33.1.)Here\'s a simple sample project file where auto-complete does not work:
This is becoming a common pattern in my code, for when I need to manage an object that needs to be noncopyable because either A. it is \"heavy\" or B. it is an operating system resource, such as a cri
Or if i nee开发者_JAVA百科d to do that, then i should just use shared_ptr?It is safe to pass scoped_ptr by reference if the callee doesn\'t need to store thewrapped pointer, and just uses it to invoke
That\'s pre开发者_如何转开发tty much it.I need to allocate memory and pass it to a function that takes a void *.I\'d like to use a shared_ptr but I don\'t know how to do it.Do you mean something like:
I don\'t really need to share t开发者_JAVA百科he objects, but i do want to make sure no memory leakage occurs.
I\'ve done enough Googling to know that if I have something like class SubObject { public: //blah blah blah
I have a C++ class(inside a dll project) whose member variables are boost::shared_ptrs to objects of other classes. Is it better to assign them inside the class constructor or have a separate init() f
I have a container of smart pointers to mutable objects.I h开发者_如何学JAVAave to write two for_each loops, one for accessing the objects as read-only data and another for mutable data.The compiler i
I recently had the following memory bug, which is easy to spot here, but can be harder to detect in more complex code: