Boost logo

Boost :

Subject: Re: [boost] [contract] concepts: pseudo-signatures vs. usage patterns
From: Dave Abrahams (dave_at_[hidden])
Date: 2012-10-11 15:41:02


on Thu Oct 11 2012, Andrzej Krzemienski <akrzemi1-AT-gmail.com> wrote:

> 2012/10/10 Matt Calabrese <rivorus_at_[hidden]>
>
>> you are NOT requiring that the model in question has a signature that
>> matches exactly, nor that the return type must be void. The match is loose,
>> including convertibility of arguments and results, and if a return type is
>> specified as void in a pseudo-signature, it will match fine with functions
>> that do not return void (just don't try to use the return type as though it
>> were something other than void when in a constrained context).
>>
>
> "The match is loose" -- I believe that this "loose match" may be a problem
> in itself. The pseudo-signatures look like any other signature so one might
> expect that they also work as any other signature. One would be surprised
> to learn they are only similar with other signatures on the surface, but
> differ in semantics due to this "loose match". In contrast, with usage
> patterns you are already alerted with the unusual syntax that the meaning
> of the declarations is unusual.
>
> My comment may be very superficial though. I do not know pseudo-signatures
> in-depth. And I do not find pseudo-signatures nferior. I only argue with
> this "loose match" idea.

Yes, it's counterintuitive, and at first, everyone has a superficial
understanding and argues with it. But it's actually what you want.

-- 
Dave Abrahams
BoostPro Computing                  Software Development        Training
http://www.boostpro.com             Clang/LLVM/EDG Compilers  C++  Boost

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