• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 // Copyright (C) 2008-2018 Lorenzo Caminiti
3 // Distributed under the Boost Software License, Version 1.0 (see accompanying
4 // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
5 // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
6 
7 // Test constructor cannot use `.precondition(...)`.
8 
9 #include <boost/contract/constructor.hpp>
10 #include <boost/contract/check.hpp>
11 
12 struct a {
aa13     a() {
14         boost::contract::check c = boost::contract::constructor(this)
15             .precondition([] {}) // Error (must use constructor_precondition).
16         ;
17     }
18 };
19 
main()20 int main() {
21     a aa;
22     return 0;
23 }
24 
25