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 error when make_old(...) not used by mistake. 8 9 #ifndef BOOST_CONTRACT_TEST_OLD_PTR_TYPE 10 #error "must define BOOST_CONTRACT_TEST_OLD_PTR_TYPE" 11 #endif 12 13 #include <boost/contract/old.hpp> 14 main()15int main() { 16 int x = 1; 17 BOOST_CONTRACT_TEST_OLD_PTR_TYPE<int> old_x = boost::contract::copy_old() ? 18 x : boost::contract::null_old(); // Error (missing make_old(...)). 19 return 0; 20 } 21 22