mirror of
https://github.com/boostorg/contract.git
synced 2026-02-27 17:02:15 +00:00
20 lines
358 B
C++
20 lines
358 B
C++
|
|
// Test destructor cannot use `.precondition(...)`.
|
|
|
|
#include <boost/contract/destructor.hpp>
|
|
#include <boost/contract/guard.hpp>
|
|
|
|
struct a {
|
|
~a() {
|
|
boost::contract::guard c = boost::contract::destructor(this)
|
|
.precondition([] {}) // Error (no dtor func arg so never pre).
|
|
;
|
|
}
|
|
};
|
|
|
|
int main() {
|
|
a aa;
|
|
return 0;
|
|
}
|
|
|