mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
[docs] Avoid repetition of 'considerable' in Error docs.
llvm-svn: 285141
This commit is contained in:
parent
3e3ce99f52
commit
be5716b316
@ -738,16 +738,16 @@ Building fallible iterators and iterator ranges
|
||||
|
||||
The archive walking examples above retrieve archive members by index, however
|
||||
this requires considerable boiler-plate for iteration and error checking. We can
|
||||
clean this up considerably by using ``Error`` with the "fallible iterator"
|
||||
pattern. The usual C++ iterator patterns do not allow for failure on increment,
|
||||
but we can incorporate support for it by having iterators hold an Error
|
||||
reference through which they can report failure. In this pattern, if an
|
||||
increment operation fails the failure is recorded via the Error reference and
|
||||
the iterator value is set to the end of the range in order to terminate the
|
||||
loop. This ensures that the dereference operation is safe anywhere that an
|
||||
ordinary iterator dereference would be safe (i.e. when the iterator is not equal
|
||||
to end). Where this pattern is followed (as in the ``llvm::object::Archive``
|
||||
class) the result is much cleaner iteration idiom:
|
||||
clean this up by using ``Error`` with the "fallible iterator" pattern. The usual
|
||||
C++ iterator patterns do not allow for failure on increment, but we can
|
||||
incorporate support for it by having iterators hold an Error reference through
|
||||
which they can report failure. In this pattern, if an increment operation fails
|
||||
the failure is recorded via the Error reference and the iterator value is set to
|
||||
the end of the range in order to terminate the loop. This ensures that the
|
||||
dereference operation is safe anywhere that an ordinary iterator dereference
|
||||
would be safe (i.e. when the iterator is not equal to end). Where this pattern
|
||||
is followed (as in the ``llvm::object::Archive`` class) the result is much
|
||||
cleaner iteration idiom:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user