Make all the member variables private, then only provide public member functions that do not change the state of the directory object.Originally Posted by MK27
This is a discussion on losing pointers with destructor within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by MK27 Also thinking the directory should always be const, is there a way to do that? (I ...
I'm trying to help a newbie and you jump up to say "that was meaningless" without bothering to understand what I said? You get moody because I called you on your comment? You expect me to give more consideration to you than you give to me? You jump down on me and call me hostile?Frankly, other than the [...] ignore you in the future?
Who the hell do you think you are? Is this a joke? HAVEN'T WE HAD THIS CONVERSATION BEFORE?!
You say you're going to ignore me? Considering that this is exemplar of our conversations would I notice the difference? Or would there just be less of you acting the part of put upon innocent because I don't offer you the preferential treatment you wrongly feel you deserve? I could get behind that. I'm certainly not going to give you a pass when screw up just because it might "really [make] [you] angry".
When I made my comment, I was fairly sure I knew what your comment was about, because I had just answered the same question of MK27's myself.Originally Posted by phantomotap
Looking at your reaction, you must have been pretty moody in order to respond the way you did.Originally Posted by phantomotap
No, I expect the same consideration.Originally Posted by phantomotap
You are being hostile.Originally Posted by phantomotap
An online acquaintance of yours from some time ago.Originally Posted by phantomotap
No, I would like to know if you want me to ignore you because I keep misinterpreting you.Originally Posted by phantomotap
I do not see how just saying that I misinterpreted you is "preferential treatment".Originally Posted by phantomotap
Neither am I going to give you a pass when you screw up, but I intend to phrase it such that I do not insult you while I am at it.Originally Posted by phantomotap
One issue with storing the file info as you traverse the directory, tho, is that the memory required can turn out to be *huge*. An easy way around that is to simply pass callback functors to the traversing logic, and then just process each file "in place". Besides being more efficient, it'll probably run much faster, too.
Here is something I posted a while back using such an approach.
Anyway, it's good to see you're finally jumping into C++ coding. Good luck!
Phantomotap, in this instance I have to say that your comment above seemed out of line. I also misunderstood what you meant and could very well have posted a similar response to what laserlight did, making the same assumption. If you've been misunderstood, you only need to state that you have been misunderstood, and then explain your point in such a way as to clear up the misunderstanding.
If my memory serves me well, you've provided valueable input in the past. So when you've put this behind you. I look forward to more valueable input from you. We all have our off days, just try and be a little more forgiving next time eh.
On the other side of things, I too have inherrited from std::vector publicly a few times. Actually I've done it twice already in the project I'm working on! I'm using it purely as an alternative to declaring functions that take the vector as an argument, and am just declaring instances of this derived class within another class. No other members are added in the derived-from-vector class. For this I think it's quite appropriate.
I believe I'm fully aware of what the effects of this are and I don't believe there are any noteworthy problems with this approach in this instance. In fact it has been used sucessfully in our production code in exactly this manner several times before.
As always, there's an exception to every rule, and an exception quite likely doesn't apply to what the OP is doing.
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"