1 2 #ifndef BOOST_CONTRACT_TEST_LIB_Y_HPP_ 3 #define BOOST_CONTRACT_TEST_LIB_Y_HPP_ 4 5 // Copyright (C) 2008-2018 Lorenzo Caminiti 6 // Distributed under the Boost Software License, Version 1.0 (see accompanying 7 // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt). 8 // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html 9 10 #include "lib_x.hpp" 11 #include <boost/contract.hpp> // All headers so test ODR for entire lib. 12 #include <boost/config.hpp> 13 14 #ifdef BOOST_CONTRACT_TEST_LIB_Y_DYN_LINK 15 #ifdef BOOST_CONTRACT_TEST_LIB_Y_SOURCE 16 #define BOOST_CONTRACT_TEST_LIB_Y_DECLSPEC BOOST_SYMBOL_EXPORT 17 #else 18 #define BOOST_CONTRACT_TEST_LIB_Y_DECLSPEC BOOST_SYMBOL_IMPORT 19 #endif 20 #else 21 #define BOOST_CONTRACT_TEST_LIB_Y_DECLSPEC /* nothing */ 22 #endif 23 24 namespace lib_y_ { // Internal namepsace. 25 void BOOST_CONTRACT_TEST_LIB_Y_DECLSPEC y_body(); 26 } 27 y()28inline void y() { 29 using boost::contract::test::detail::out; 30 boost::contract::check c = boost::contract::function() 31 // Capturing [&] so out() visible in MSVC10 lambdas. 32 .precondition([&] { out("y::pre\n"); }) 33 .old([&] { out("y::old\n"); }) 34 .postcondition([&] { out("y::post\n"); }) 35 ; 36 lib_y_::y_body(); 37 } 38 39 #endif 40 41