Vector Class: Language-based memory leak??

Pages: 12
Well they are. They all are ways of specifying the scope of the variable you want to access. It just so happens that the variable all 3 forms are accessing are the same.
I'm sorry if I seem a bit harsh, but it is in the code. If somthing makes it hard to read, please tell me... ...Mabey you're refering to the map in the snapshot_class?? If so, that is so that the memory for that map is used as efficienty as possible. As you can see, it is a smart pointer.

A map is a map. It is never a smart pointer. You may have a smart pointer that points to a map (and please note that a smart pointer is a pointer,) but a smart pointer is not a map, and a map is not a smart pointer.


I have also observed that smart pointers clear their memory faster than when using map<class, class>().clear().

You have observed nothing of the sort. The methods of map have nothing to do with a smart pointer.

You complain because it is apparent to you that people aren't spending enough time studying your code while it is apparent to those people that you haven't spent enough time studying the language constructs you are attempting to use, but it's hard to point that out to you since you deny using them. Sorry to be harsh, but it's true.

When presenting code that you need debugged or analyzed because you aren't up to the task, please reduce it to a minimal, compilable snippet of code that reproduces the problem. Often in doing so, you'll hit on the answer yourself - in fact it's a rather productive debugging practice when it's possible to do so. Anybody's time who might help you on here is just as important as yours. If you can't bother with a response that isn't "read the code" to someone who obviously has, you're going to find yourself getting responses like "RTFM," which you should do, by the way.
Cire Said:
...you haven't spent enough time studying the language constructs you are attempting to use...

Could you clarify? I would like to know more. I have looked at some of the header files, and I can't quite say I completely understand them. I have to assume most of the syntax I can't 'decipher' (for lack of a better term) is an object which is either a class, or somthing that has been defined with typdef. If you could refer me to some resources, I would appreciate it. I am always looking to understand C++ more. I can not seek to learn what I do not know I need.

Cire said:
When presenting code that you need debugged or analyzed because you aren't up to the task, please reduce it to a minimal, compilable snippet of code that reproduces the problem.


Alright.

Cire said:
You have observed nothing of the sort. The methods of map have nothing to do with a smart pointer.


Interesting. I will write a small program and see if I can't replicate the results... If the results are conclusive and I can not solve it, I will post it in a compile-able way.

EDIT:
I have a lot of homework, so it will be a while until I am able to fully commit to this problem. I wont be able to post the code for a while.
Last edited on
@IWishIKnew
Off topic but I noticed how you are doing quotes.

[ quote=IWishIKnew]I have a lot of homework, so it will be a while until I am able to fully commit to this problem. I wont be able to post the code for a while.[/quote]

renders as (minus the space in opening tag)
IWishIKnew wrote:
I have a lot of homework, so it will be a while until I am able to fully commit to this problem. I wont be able to post the code for a while.
Topic archived. No new replies allowed.
Pages: 12