|
Boost : |
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.
Too bad.
> 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?
Arno
-- 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