#include #include #include #include #include #include #include namespace boost { template< class T > struct decayed { typedef typename mpl::eval_if< is_array, mpl::identity::type*>, typename mpl::eval_if< is_function, add_pointer, mpl::identity > >::type type; }; template< class F, class S > inline std::pair< typename decayed::type, typename decayed::type > make_pair( const F& f, const S& s ) { return std::pair< BOOST_DEDUCED_TYPENAME decayed::type, BOOST_DEDUCED_TYPENAME decayed::type >( f, s ); } template< class F, class S > inline std::pair< typename decayed::type, typename decayed::type > make_pair( F& f, S& s ) { return std::pair< BOOST_DEDUCED_TYPENAME decayed::type, BOOST_DEDUCED_TYPENAME decayed::type >( f, s ); } } #include int proc1() { return 0; } int proc2(int c) { return c; } int main() { #if (defined __BORLANDC__) # pragma warn -8004 // never used values #endif boost::decayed::type integer = 1; boost::decayed::type char_ptr = "foo"; boost::decayed::type cchar_ptr = "foo"; boost::decayed::type wchar_ptr = L"foo"; boost::decayed::type cwchar_ptr = L"foo"; std::pair p = boost::make_pair( "foo", "bar" ); std::pair p2 = boost::make_pair( "foo", 1 ); #ifndef BOOST_NO_STD_WSTRING std::pair p3 = boost::make_pair( L"foo", "bar" ); std::pair p4 = boost::make_pair( L"foo", 1 ); #endif int array[10]; std::pair p5 = boost::make_pair( array, array ); #ifndef __BORLANDC__ std::pair p6 = boost::make_pair(proc1, proc2); p6.first(); p6.second(1); #endif return 0; }