mirror of
https://github.com/boostorg/contract.git
synced 2026-01-27 06:42:20 +00:00
20 lines
364 B
C++
20 lines
364 B
C++
|
|
// Test constructor cannot use `.precondition(...)`.
|
|
|
|
#include <boost/contract/constructor.hpp>
|
|
#include <boost/contract/guard.hpp>
|
|
|
|
struct a {
|
|
a() {
|
|
boost::contract::guard c = boost::contract::constructor(this)
|
|
.precondition([] {}) // Error (must use constructor_precondition).
|
|
;
|
|
}
|
|
};
|
|
|
|
int main() {
|
|
a aa;
|
|
return 0;
|
|
}
|
|
|