[ConceptGCC] |
ConceptGCC :Re: Concepts in std::string; default implementations |
From: Doug Gregor (dgregor_at_[hidden])
Date: 2007-04-09 15:23:14
On Apr 9, 2007, at 1:10 PM, Martin Sebor wrote:
> Douglas Gregor wrote:
> [...]
>>> 3) Is the ';' needed after concept or concept_map? AFAIK no, but
>>> in all
>>> examples in the tutorial it's there.
>>
>> The ';' is optional after a concept or concept_map.
>
> Out of curiosity, is it optional because gcc allows it or is it
> in the grammar that way?
The optional ';' is in the grammar.
> (AFAIK, the current grammar doesn't allow
> stray semicolons at namespace scope, e.g., after the closing brace
> of a namespace block, and there are compilers out there that give
> errors for violations).
Right, and it causes unnecessary pain for users who don't understand
why class definitions need to be followed by ';' but function
definitions do not. So, we let ';' be optional after concepts and
concept maps.
Cheers,
Doug