Questions tagged [boost-smart-ptr]
37 questions
0
votes
1 answer
Qt Signals and Slots with Boost::smart_ptr
So what I am trying to do is use Qt signals and slots to pass around an image through a smart_ptr so that it will delete itself when everything that needs to use the data is done accessing it.
Here is the code I have:
Class A, inherits…

colossus47
- 99
- 9
0
votes
1 answer
class not being recognized as friend
I have two classes say foo and bar. The constructor of foo is private so as to only allow the bar class to instantiate it.
// foo.h
class foo
{
friend class bar;
private:
foo()
{}
};
// bar.h
class bar
{
public:
bar()
{
foo* f =…

MistyD
- 16,373
- 40
- 138
- 240
0
votes
2 answers
shared_ptr increase parent reference
pseudo code :
typedef shared_ptr ptr_child;
typedef shared_ptr ptr_parent ;
class A
{
public:
A()
{
child = ptr_child(new B);
}
ptr_child getB()
{
return child;
}
private:
ptr_child child;
};
I…

Nolan Hyde
- 212
- 2
- 8
0
votes
1 answer
Mysterious write violation on my variable
I have an library that don't give correct output. I guess it is possibly an write violation, and focused it on this section of code:
void Page::build_default_frame(PosType genome_display_length)
{
Frame* frame = new Frame(*this,
…

jiandingzhe
- 1,881
- 15
- 35
0
votes
1 answer
failed to used correct function for boost intrusive_ptr
I'm trying to wrap Cairo with intrusive_ptr.
As the things in Cairo already have reference counting, I wrote a very simple wrap:
#include
inline void intrusive_ptr_add_ref(cairo_surface_t* self)
{
…

jiandingzhe
- 1,881
- 15
- 35
0
votes
1 answer
Boost Scoped Pointer To Boost Thread
Today I want to use a boost::scoped_ptr to point to a boost::thread.
In my Thread.h I have boost::scoped_ptr m_thread and in my Thread.cpp there's a function create() in which the creation of the boost::thread should take place.
I…

DenverCoder21
- 879
- 3
- 16
- 34
-1
votes
1 answer
Move semantic of shared_ptr
I just started learning smart pointer and came across a situation which seems to be contradicting with the theory.
For e.g. When we use shared_ptr and if copy semantic is called the both the object shares the ownership and ref count is 2. This is…

Nihal Kumar
- 305
- 3
- 16