Well, you cannot really use inheritance based polymorphism anyway since the base class has no virtual member functions.Originally Posted by phantomotap
Well, you cannot really use inheritance based polymorphism anyway since the base class has no virtual member functions.Originally Posted by phantomotap
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
I was going to give you the benefit of doubt. I've changed my mind. No explanation for you. That was stupid. You either jumped in with some random quip without bothering to understand what I was saying or you truly have no idea what you're talking about.Well, you cannot really use inheritance based polymorphism anyway since the base class has no virtual member functions.
It's just one of many possible ways to have the interface you want without inheriting `std::vector<???>'.Phantomotap also implies a solution, "You could export the member as a public interface", not sure where that fits in.
Soma
Perhaps a third party view here would help.
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.
My homepage
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"