mirror of
https://github.com/boostorg/contract.git
synced 2026-02-27 04:52:22 +00:00
added deep search of inheritance graph
This commit is contained in:
19
test/constructor/no_pre_error.cpp
Normal file
19
test/constructor/no_pre_error.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user