Boost logo

Boost :

Subject: Re: [boost] [contract] toward N3351 concepts
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2012-10-02 03:26:09


> > BTW, why do we declare concepts like:
> >
> > concept EqualityComparable< typename T > = ... // (1)
> >
> > Instead of:
> >
> > template< typename T >
> > concept EqualityComparable = ... // (2)
> >
> > I personally prefer (2) because the template parameters are declared
> > with a syntax that is more consistent with the syntax used to declare
> > them in class/function templates. For similar reasons, I'd prefer {
> > ... } instead of = ... for the concept definition part.
>
> Does anyone have an opinion/rationale about the syntax of (1) vs. the
> one of (2)?
>

At least at first glance, it looks like either syntax has similar
capabilities and would work. The latter one though, looks as any other
template declaration and might incorrectly imply that I can change it into
a non-template declaration:

  // no template parameters
  concept EqualityComparable = //

But I am not sure if this is a relevant concern.

Regards,
&rzej


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk