|
Boost : |
Subject: Re: [boost] [concept] why is `requires` plural?
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2010-05-27 09:52:41
On Tue, May 25, 2010 at 5:20 PM, Stefan Seefeld <seefeld_at_[hidden]> wrote:
> On 05/25/2010 05:13 PM, Lorenzo Caminiti wrote:
>>
>> I see but then the argument would be that C++ uses `return` (infinite
>> form of the verb) and not `returns` for "this function returns this
>> value".
>>
>
> No, "returns" would be declarative, while "return" is imperative. This is a
> "return-statement", not a "return-declaration", after all. :-)
I was thinking: What about `throw` for exception specifications?
Shouldn't that also be `throws` (3rd person) because it is declaring
the exceptions that the function can throw?
// Declarative in exception-specification-declaration "f throws
int and double" -- shouldn't be `throws` (3rd person)?
void f() throw(int, double) {
// Imperative in throw-statement "throw int -1" -- so `throw`
(infinite form) is OK.
throw int(-1);
}
Also I looked at all C++/C++0x keywords and I couldn't find any other
3rd person keyword... would `requires` eventually be the only one?
-- Lorenzo P.S. I think part of the reason I have these type of questions is because English is not my first language. Thanks a lot for taking the time to explain.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk