|
-
July 28th, 2010, 05:15 AM
#5
Re: vector private inheritance
 Originally Posted by Yves M
2) Basically yes. However, you should write a big comment at the start of your class definition that "This inheritance is private and should remain so, suck up to re-writing accessors" ;-)
my class looks something like this
Code:
class myClass : std::vector<int>
{
public:
//my own functions
public:
using std::vector<int>::size();
using std::vector<int>::max_size();
}
rather than re-writing accessors. Is there something wrong with that?
But I agree about the big comment
Is your question related to IO?
Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|