Subject: Re: [boost] lifetime of ranges vs. iterators
From: Arno SchÃ¶dl (aschoedl_at_[hidden])
Date: 2008-09-03 15:14:18
> > This "skipping" in recursion needs exceptions. Exceptions are the only
> > means C++ gives us to "jump" in a recursive environment.
> I don't know what recursion you are referring to.
The stack of adaptors calling each other.
> Only for the non-exceptional path.
> but I have no practical experience.
> My advice: forget exceptions. They're totally inappropriate in this
> context IMO.
IMO, you need some sort of jump to solve the repeated end-checking problem. If the base iterator end check is nested into functions, the only way to transport this information out is via exceptions. If you don't like exceptions, the "I am at the end of the underlying sequence" information must be generated at the outermost level of the function tree. If it is generated anywhere else, there is simply no way to transport the information out without checking the return value of a function, which is the extra check we want to avoid. Do we agree?
-- Dr. Arno Schoedl Â· aschoedl_at_[hidden] Technical Director think-cell Software GmbH Â· Invalidenstr. 34 Â· 10115 Berlin, Germany http://www.think-cell.com Â· phone +49-30-666473-10 Â· toll-free (US) +1-800-891-8091 Directors: Dr. Markus Hannebauer, Dr. Arno Schoedl Â· Amtsgericht Charlottenburg, HRB 85229
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk