Boost logo

Boost :

Subject: Re: [boost] [contract] static_assert in contracts or not?
From: Dave Abrahams (dave_at_[hidden])
Date: 2012-09-16 21:30:16

on Thu Aug 30 2012, Lorenzo Caminiti <> wrote:

> In this case, would it ever make sense to use static_assert in
> postcondition and/or class invariants even if that were allowed?

The only good excuse I can think of for doing so is that you happen to
have calculated some type or constant needed for the assertion in the
scope of the postcondition and/or class invariant, and you want to keep
it there.

Not terribly compelling unless you can show there's a large class of
examples like this, IMO.

Dave Abrahams
BoostPro Computing                  Software Development        Training             Clang/LLVM/EDG Compilers  C++  Boost

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