4 ms·
Why do you show this to me??? Don't you think I know it? I don't know what you are upset by this, cppreference is great and it explains the problem you had. I
by CyberDildonics 2mo ago
Why do you show this to me??? Don't you think I know it?
I don't know what you are upset by this, cppreference is great and it explains the problem you had.
I blamed it on STL (and its complexity).
If you make a simple dequeue with a vector any resize is going to invalidate pointers. It isn't the STL's fault, it's meant to queue simple data for ordering so that you can copy it in and out, not hold on to a pointer to something internal. It isn't meant for actual storage just basic structure.
std::deque is a super bad offender, in many ways. I advise against using it.
You brought it up as something you were using.
No I have not misunderstood anything. Again you're coming back to your arrogant pattern.
It's not arrogant to point out how things work. In this case the pointer to a reference count is pointing to internal data in the data structure so that other threads can see it. This is not the same as shared_ptr which is tracking a reference count of itself.
But I rarely don't do that. And that's not implied by "C style" at all.
So you frequently do that? It's your C style, that's what you showed me and it takes two heap allocations so that a pointer can be returned. If you create a pointer to a struct in a function it can't point to the stack inside the function.
So please stop repeating made-up contradictions.
You did say you got burned by an assumption of pointer invalidation and that was your explanation for how the STL gave you problems with concurrency.
Claims without evidence unfortunately...
There are benchmarks and lots of people use these queues. I've used them and you can use them yourself. It isn't like saying something is bad then not being able to explain it. You and anyone else can and do use these. It is an opinion, but it is backed up by a lot including a great interface.
Good, because I don't do that at all.
Then you probably have memory leaks because you need to call the free functions that you make when you create a data structure.
And I criticize that RAII is a system that sneaks in resource management _implicitly_ everywhere
No, you said that it created implicit program flow, now you're walking that back I guess.
Also it isn't everywhere, it's only where it needs to be, so I don't know why you wouldn't want it there.