« first day (330 days earlier)      last day (4620 days later) » 

11:03 PM
Em....I just realized a erasing an element from the list doesn't call the destructor
 
Gotta love people that write movie synopses with spoilers.
 
I held pointers in a list but when I erase the pointer the destructor the object isn't destructed
@RMartinhoFernandes we know what blurbs ha :P
Even better is trailers that give you the story xD
 
@LewsTherin Don't use pointers. If you use values, the std::list (that's what you're using, right?) takes care of destruction.
 
I have to use pointers...I haven't written a copy constructor yet..
maybe I should do that then..
I don't think delete *it is safe
 
You really need to learn to write C++ without pointers all over.
 
11:06 PM
@LewsTherin how does using pointers have any relation with not having written a copy ctor yet?
 
I have dynamic content in the class
for example I have pointer to a bitmap
 
oh sure, yes
 
the bitmap is declared as this BITMAP *bitmap
 
why don't you use std::shared_ptr?
 
yeah, that's why...@RMartinhoFernandes I doubt that is possible...
Haven't learned how to use it
I'm scared ...sounds hard
 
11:09 PM
std::shared_ptr<BITMAP> bitmap_ptr = std::shared_ptr<BITMAP>(new BITMAP());
 
Use a smart pointer like Tony suggested.
 
not that hard
 
std::shared_ptr<BITMAP> bitmap_ptr = std::make_shared<BITMAP>();
:)
 
now the shared_ptr owns the object pointed to and this is ref counted, so you can share it
oh lulz, I always forget about make_shared, damnit
 
...
Would I be able to pass by value then the object
because when the temp object is destroyed
the destructor deletes the bitmap
 
11:12 PM
shared_ptr takes care of that. Only when the last shared_ptr is gone will he bitmap be deleted.
 
mmn..that sounds like it could be useful :)
Ok will go and read it now....ty and ciao :P
 
:)
0
Q: C++11 library features dependent on compiler specific proxys

graphitemasterIt's been brought to my attention by trial and error that there are certian C++11 features that depend on some sort of compiler magic (TM). I've been messing around with implementing my own standard conformant stdlib. I know there are readily available implementations of the stdlib, but this on...

 
11:28 PM
how does this answer sound?
0
A: QDatastream operator>> for QList<Class*>

Tony The LionBecause you want to alter what rhs points to, you should pass a pointer to pointer as an argument to your operator. Also, doing that, the changes to the pointer, will be reflected when the function returns. QDataStream & operator >>(QDataStream &dataStream, Faction **rhs) { *r...

 
11:45 PM
 
user457812
George Carlin and warm soup is good for colds
 

« first day (330 days earlier)      last day (4620 days later) »