Boost logo

Boost :

Subject: Re: [boost] [contract] first attempt to N3351 concepts
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2012-10-10 04:51:01


>
> > Since you asked what I think,
> >
> > "pseudo-signatures > usage patterns"
> >
> > but that's probably not the kind of information you were looking for :-)
>
> Yes, that's more of a critique to N3351 than my design to implement it
> but it's a fare comment. If N3351 approach is to be abandoned in favor
> of pseudo-signatures then no point in implementing N3351 but I don't
> think there's consensus on this either way yet. I personally don't
> have an opinion yet... (and maybe I should have an opinion before I go
> off an impl the entire N3351).
>

Even if you decide to go with pseudo-signatures, one novel thing from N3351
is worth adapting: treating every concept as a predicate, so that the
programmer can check himself whether a certain set of types models the
concept:

  static_assert( ForwardIterator<int*>, "ouch" );

and so that you can combine concept requirements with any boolean
meta-function:

  template <class T> requires Copyable<T> && sizeof(T) < 8 ...

Regards,
&rzej


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