Subject: Re: [boost] [Review:Algorithms] - Review by Neil Groves
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2011-10-18 13:02:10
Marshall Clow wrote:
> On Oct 18, 2011, at 5:30 AM, Stewart, Robert wrote:
> > Marshall Clow wrote:
> >> How about this:
> > You can be more succinct:
> I'm not really sure that being succinct is a goal.
In and of itself, it isn't, but when clarity is retained, succinctness is better. There might be the rub, however.
> >> [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.
> This is a case where a bit of rationale adds to the
> explanation, I think.
Your rationale added nothing, as far as I'm concerned. Besides, a statement like, "when there are no items...they all satisfy", is nonsensical. No matter how you try to rationalize the result, the other could be justified equally. That is, since there are no elements, none satisfied the criteria, so return false. Returning true or false for empty ranges is determined by fiat.
Rob Stewart robert.stewart_at_[hidden]
Software Engineer using std::disclaimer;
Dev Tools & Components
Susquehanna International Group, LLP http://www.sig.com
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.