scoped-ptr Questions
5
Solved
scoped_ptr is not copy able and is being deleted out of the scope. So it is kind of restricted shared_ptr. So seems besides the cases when you really need to restrict the copy operation shared_ptr ...
Slurry asked 20/11, 2009 at 14:7
1
Consider the following code snippet. The destructor of boost::scoped_ptr is invoked at the end of the main function. The destructor uses boost::checked_delete to deallocate the encapsulated Widget ...
Claudieclaudina asked 19/7, 2014 at 13:47
3
Solved
I usually use a boost::scoped_ptr for pimpl's (for one reason because then I don't get surprises if I forget to deal with the copy constructor)
With templates however I can't just put the destruc...
Intenerate asked 5/12, 2011 at 14:5
2
Solved
I have just started using c++ boost libraries. I read in many places that when a scoped_ptr is used then the object is always destroyed even in case of exceptions.
They behave much like built-in...
Fortin asked 14/10, 2012 at 23:17
3
Solved
I have working in large application which contain c and cpp. The all files saved as cpp extension but the code is written in c- style. I mean it is define structure rather than class allocate memor...
Billybillycock asked 4/9, 2012 at 13:36
3
Solved
I want to use smart pointer in my c++ application.
Which header file I should include for using std scoped_ptr?
Fellowship asked 23/7, 2012 at 12:10
3
Solved
Boost's make_shared() function promises to be exception-safe while attempting to create a shared_ptr.
Why is there no make_scoped() equivalent? Is there a common best practice?
Here's a code exam...
Quinquennial asked 5/7, 2012 at 2:46
4
What is the objective of scoped pointer? to my understanding, the scoped pointer manages the memory within a block of code. If i want to declare a variable within a block , i can just declare it on...
Glynda asked 24/5, 2012 at 0:2
4
Solved
I am using scoped_ptr inside small functions like this. so that I don't have to call delete. Is this an overkill for this usage? My team members prefer raw pointers and delete. What is the cost of ...
Moor asked 27/4, 2012 at 12:51
5
Solved
Why is the destructor not invoked in this code?
#include <boost/scoped_ptr.hpp>
#include <iostream>
class MyClass {
boost::scoped_ptr<int> ptr;
public:
MyClass() : ptr(new int) ...
Hbeam asked 2/4, 2012 at 6:32
2
Solved
Is the sole difference between boost::scoped_ptr<T> and std::unique_ptr<T> the fact that std::unique_ptr<T> has move semantics whereas boost::scoped_ptr<T> is just a get/res...
Adventurous asked 20/11, 2011 at 6:7
3
Or if i need to do that, then i should just use shared_ptr?
Dinesh asked 21/3, 2010 at 19:19
2
Solved
Can a class member of type boost::scoped_ptr be initialized inside the class' constructor? How?
(Not in the initialization list)
Pooley asked 14/1, 2011 at 14:55
1
© 2022 - 2024 — McMap. All rights reserved.