Boost logo

Boost :

Subject: Re: [boost] [contract] first attempt to N3351 concepts
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2012-10-10 04:37:48

On Wed, Oct 10, 2012 at 12:54 AM, Andrzej Krzemienski
<akrzemi1_at_[hidden]> wrote:
> 2012/10/9 Lorenzo Caminiti <lorcaminiti_at_[hidden]>
>> Hello all,
>> I made a first attempt to sketch how N3351-like concepts will look
>> into Boost.Contract (just for the find algorithm and its concepts for
>> now):
>> This code doesn't compile quite yet but I played with its bits and
>> pieces enough to conclude that it should be implementable as listed.
>> It will take quite a bit of time and effort to implement this...
>> Please tell me what you think now so I don't waste time implementing
>> this design if it has issues.
> N3351 allows specifying sort-of postconditions with axioms, like:
> axiom Clearing(Vec vec) {
> vec.clear(), vec.empty();
> }

Yes, this won't work.

> This uses the comma operator in a tricky way to perform two instructions. I
> wonder if this will interfere with the way the comma is interpreted in
> Boost.Contract. Is it possible in your design to type:
> axiom(
> (vec.clear(), vec.empty())
> )

Yes, this should work.

But then again, given that we are only checking axioms syntax and we
are not running them, it won't make any difference in practice...


Boost list run by bdawes at, gregod at, cpdaniel at, john at