9,691 reputation
12942
bio website
location
age
visits member for 3 years, 11 months
seen 4 hours ago

Sep
6
awarded  Guru
Sep
4
awarded  Good Answer
Jun
26
awarded  Taxonomist
Jun
12
comment In C++ Good reasons for NOT using symmetrical memory management (i.e. new and delete)
Well a smart pointer does the shallow copy... It all depends on whether a memory buffer stays within your object or whether it needs to be passed to other objects. And you are correct, wrapping your pointer data members into smart pointers can save you the need of writing a copy constructor.
Jun
12
comment In C++ Good reasons for NOT using symmetrical memory management (i.e. new and delete)
There are objects that are too big to be copied. For example if you are working with high resolution images, you don't want to have to keep copying a image buffer every time you need to pass it into a function.
Jun
12
comment In C++ Good reasons for NOT using symmetrical memory management (i.e. new and delete)
Oh, no offence at all. :) The shared object is allocated immediately before constructing the shared_ptr, literally in the same statement ptr = shared_ptr<MyClass>(new MyClass), and then it is deleted by the shared_ptr's destructor when necessary. I suppose you can argue that this is not symmetric memory management, but I think it is pretty close to it.
Jun
12
comment In C++ Good reasons for NOT using symmetrical memory management (i.e. new and delete)
Wait, I was saying that passing a raw pointer into a function, that would have to delete it explicitly is outdated. Passing smart pointers around is certainly not outdated. I don't know what Qt is doing these days.
Jun
11
comment In C++ Good reasons for NOT using symmetrical memory management (i.e. new and delete)
@metamaker, you certainly can. Except it will only be used by your own code, but not by third-party libraries, which greatly limits its effectiveness. You are much better off using RAII, which generalizes to other types of resources.
Jun
11
revised In C++ Good reasons for NOT using symmetrical memory management (i.e. new and delete)
added 55 characters in body
Jun
11
comment In C++ Good reasons for NOT using symmetrical memory management (i.e. new and delete)
@metamaker, uhm... C++ doesn't have garbage collection...
Jun
11
revised In C++ Good reasons for NOT using symmetrical memory management (i.e. new and delete)
added 173 characters in body
Jun
11
answered In C++ Good reasons for NOT using symmetrical memory management (i.e. new and delete)
Jun
11
revised looking for a short explanation of fuzzy logic
added 4 characters in body
Jan
21
revised How should I validate code when there is no one to do code review?
added 3 characters in body
Jan
20
answered How should I validate code when there is no one to do code review?
Jan
14
comment Intentional misspellings to avoid reserved words
@Kieveli: funny.
Jan
14
revised C++ - Constructor or Initialize Method to Startup
deleted 2 characters in body
Dec
30
comment Best practices for using namespaces in C++
@SamGoldberg: it gets better. I found a good answer to this question here: en.wikipedia.org/wiki/Package_Principles. I posted this answer, and a moderator deleted it, because I simply posted the link and didn't have the time to copy/paste the content.
Dec
6
comment Is UML a good way to shortly and simply explain a concept?
@TMN, now that's being prepared!
Dec
6
comment Is UML a good way to shortly and simply explain a concept?
You are welcome. Good luck with the job search!