|
Boost : |
Subject: Re: [boost] [contract] concepts: pseudo-signatures vs. usage patterns
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2012-10-11 17:27:51
On Thu, Oct 11, 2012 at 5:25 AM, Andrew Sutton <asutton.list_at_[hidden]> wrote:
>> Look for example at
>> http://www.sgi.com/tech/stl/find_if.html. I can easily satisfy all the
>> stated requirements and produce an example that won't compile. I can
>> also easily fail to satisfy the stated requirements and produce an
>> example that *will* compile. That's because there's a great deal of
>> potential mischief hiding in expressions such as
>>
>> f(*p)
>
>
> Can you produce those examples? You've made me curious.
Andrew, what were the reasons in N3351 to move away from
pseudo-signatures and toward usage-patterns?
I red N3351 but if I had to summarize the rationale for the
usage-pattern approach instead of C++0x concept's pseudo-signature
then I'd say that N3351's argument is that its concept design for STL
algorithms is "simpler" using usage-pattern than using C++0x
pseudo-signatures. However, "simpler" is a subjective metric... I'm
sure I'm missing something maybe reading N3351 one more time will
clarify my thinking.
Thanks a lot!
--Lorenzo
P.S. IMO, this discussion now belongs in the Boost ML given that there
are two potential Boost libs that are considering implementing
concepts. N3351 and other concept proposal authors should join the
discussion on the Boost ML if at all possible so they will be able to
see their ideas and proposals implemented in the language (even if
just in the form a lib).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk