Boost logo

Boost :

Subject: Re: [boost] [Review:Algorithms] - Review by Neil Groves
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2011-10-18 08:30:08

Marshall Clow wrote:
> How about this:

You can be more succinct:

> [heading Complexity]
> All of the variants of `all_of` and `all_of_equal` run in
> ['O(N)] (linear) time; that is, they compare against each
> element in the list once. If any of the comparisons fail, the
> algorithm will terminate immediately, without examining the
> remaining members of the sequence.

All variants of `all_of` and `all_of_equal` have ['O(N)] (linear) complexity. If an element fails the comparison, the algorithms return immediately. Otherwise, all elements in the input sequence are compared exactly once.

> [heading Exception Safety]
> All of the variants of `all_of` and `all_of_equal` take their
> parameters by value or const reference, and do not depend upon
> any global state. Therefore, all the routines in this file
> provide the strong exception guarantee.

All variants of `all_of` and `all_of_equal` provide the strong exception guarantee.

> [heading Notes]
> * `all_of` and `all_of_equal` both return true for empty
> ranges, no matter what is passed to test against. When there
> are no items in the sequence to test, they all satisfy the
> condition to be tested against.

[heading Empty Ranges]

All variants of `all_of` and `all_of_equal` always return true for empty ranges.

Rob Stewart robert.stewart_at_[hidden]
Software Engineer using std::disclaimer;
Dev Tools & Components
Susquehanna International Group, LLP


IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

Boost list run by bdawes at, gregod at, cpdaniel at, john at