mirror of
https://github.com/boostorg/contract.git
synced 2026-02-27 17:02:15 +00:00
20 lines
346 B
C++
20 lines
346 B
C++
|
|
#include <boost/contract/constructor.hpp>
|
|
|
|
// Test pre cannot be set for constructors
|
|
// (destructors use same setter objects, so no need to test those too).
|
|
|
|
struct a {
|
|
explicit a() {
|
|
auto c = boost::contract::constructor(this)
|
|
.precondition([&] {}) // Error.
|
|
;
|
|
}
|
|
};
|
|
|
|
int main() {
|
|
a aa;
|
|
return 0;
|
|
}
|
|
|