Yes.
Fine.
Implementations whose name implies something they will not do are bad.
Implementations that try to delete a this pointer is probably bad code.
All I said was that it was a good...
Type: Posts; User: Elysia
Yes.
Fine.
Implementations whose name implies something they will not do are bad.
Implementations that try to delete a this pointer is probably bad code.
All I said was that it was a good...
I apparently made the mistake of taking some code that contained two pointers while only decorating one of them (I completely forgot about the other one).
That's why I made another example where I...
Then I don't see your point.
But as you seem unwilling to explain the problem further... *shrug* I'll just let it be, then.
But I will assure you that it wasn't trolling.
No need to scare the cat so much.
I looked at it from "I don't know what QtAutoDeleter does" perspective, nevermind that I wrote it.
The reason I say it is good is that the line implies that it...
Of course there are going to be people who do not understand it. That's life.
If I create some void foo(std::list), then there are going to be some people who do not understand what it is (List?...
Yes, I am asking for decorations because it is an easy way to self decorate the interface.
Sure, but how does it decorate the interface? This can decorate the line where you call the function,...
You know, a simple
auto edit = new QTextEdit(auto_deleter(this));
would have been just fine to self document that line of code. Obviously auto_deleter would be defined as something like
...
Even reading the documentation does not make one an expert. It is easy to not know where to use new and where one must delete. A self documenting interface reduces this problem.
I don't disagree with you. I'm not saying that Qt is built in a bad way (although looking at it from a C++11 perspective, perhaps it was; but then again, it was built before C++11, so we really can't...
I am not backpedalling.
I mentioned delete what you new because obviously I did not know Qt does something as insane as automatically destroying objects because it isn't self documenting.
Sure, I...
There never was any question as to whether the information could be found easily or not.
What is your point? I know it documents the behaviour somewhere, but that wasn't the point.
I'm not saying it's wrong. I'm saying it's not self-documenting.
A raw pointer could mean anything:
- Is it because a reference is not possible/practical in this case, and hence we just want a...
Of course I don't, unless the interface uses a smart pointer of some sort. How am I supposed to know?
You realize that you can create an object without using new, right?
So instead of
QTextEdit *edit = new QTextEdit(this);
edit->setGeometry(5, 5, 200, 150);
You can do
QTextEdit...