// Copyright Peter Dimov 2015 // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) #ifdef TEST_STD # include #else # include #endif #include "test.hpp" #include "check_type.hpp" #include template struct X { T t_; X(): t_() {} template X( X const & x ): t_( x.t_ ) {} }; namespace boost { template struct common_type< X, X > { typedef X::type> type; }; } // namespace boost TT_TEST_BEGIN(common_type_5) { // user specializations, binary BOOST_CHECK_TYPE3( tt::common_type< X, X >::type, X ); BOOST_CHECK_TYPE3( tt::common_type< X&, X& >::type, X ); BOOST_CHECK_TYPE3( tt::common_type< X&, X const& >::type, X ); BOOST_CHECK_TYPE3( tt::common_type< X const&, X& >::type, X ); BOOST_CHECK_TYPE3( tt::common_type< X const&, X const& >::type, X ); BOOST_CHECK_TYPE3( tt::common_type< X, X >::type, X ); BOOST_CHECK_TYPE3( tt::common_type< X&, X& >::type, X ); BOOST_CHECK_TYPE3( tt::common_type< X&, X const& >::type, X ); BOOST_CHECK_TYPE3( tt::common_type< X const&, X& >::type, X ); BOOST_CHECK_TYPE3( tt::common_type< X const&, X const& >::type, X ); // ternary BOOST_CHECK_TYPE4( tt::common_type< X&, X const&, X volatile& >::type, X ); } TT_TEST_END