|
-
May 11th, 2011, 05:45 AM
#16
Re: Resource management--circular linked list
 Originally Posted by superbonzo
uhm, I would advice against such an adaptor because it does not fulfill the container concept requirements ( just consider that size() should be equal to std:  istance( begin(), end ) ); IMHO, if one really wants such an infinite sequence view of a bidirectional container It's better to write an iterator adaptor instead. Actually, I don't think the OP really needs one.
True, but I did advise using a circular link to begin with. Maybe adapting just the iterator (which is where the bulk of the code is anyways) is a better idea.
 Originally Posted by superbonzo
BTW, unless I'm missing something, the "friend class circular_list;" is unnecessary because member classes have always access to the containing class private data.
That's what I thought, but I get compile errors saying those members are inaccessible, both with mingw and comeau.
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.
Tags for this Thread
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
|