Date: Fri, 17 Oct 2025 12:03:45 +0200
Thanks Ville,
On the internet I saw someone saying
void fun(Foo* ptr) pre (ptr!=nullpter), pre(ptr->hasData()) { ... }
might be a problem (for the second pre) and should be written like this
void fun(Foo* ptr) pre (ptr!=nullpter && ptr->hasData()){ ... }
is that true?
Thanks, Harald
On 2025-10-17 10:43, Ville Voutilainen wrote:
> On Fri, 17 Oct 2025 at 11:22, Harald Achitz via SG21
> <sg21_at_[hidden]> wrote:
>> A short question:
>>
>> is it true that it is not specified how often and in which order contracts (pre post conditions) are evaluated,
>> and if it is, I wonder what is means for 'as close as possible'
> See [basic.contract.eval]/18, [expr.call]/7, and [expr.call]/9.
On the internet I saw someone saying
void fun(Foo* ptr) pre (ptr!=nullpter), pre(ptr->hasData()) { ... }
might be a problem (for the second pre) and should be written like this
void fun(Foo* ptr) pre (ptr!=nullpter && ptr->hasData()){ ... }
is that true?
Thanks, Harald
On 2025-10-17 10:43, Ville Voutilainen wrote:
> On Fri, 17 Oct 2025 at 11:22, Harald Achitz via SG21
> <sg21_at_[hidden]> wrote:
>> A short question:
>>
>> is it true that it is not specified how often and in which order contracts (pre post conditions) are evaluated,
>> and if it is, I wonder what is means for 'as close as possible'
> See [basic.contract.eval]/18, [expr.call]/7, and [expr.call]/9.
Received on 2025-10-17 10:03:50
