result_of: merge [80445], [80452], [80535], [80550], [80605], [80608] from trunk

[SVN r80621]
This commit is contained in:
Eric Niebler
2012-09-21 18:49:46 +00:00
parent 1920623a4f
commit 7d8353f46a
4 changed files with 432 additions and 9 deletions
+26
View File
@@ -129,6 +129,27 @@ struct no_result_type_or_result_template
#endif
};
// sfinae_tests are derived from example code from Joel de Guzman,
// which demonstrated the interaction between result_of and SFINAE.
template <typename F, typename Arg>
typename boost::result_of<F(Arg const&)>::type
sfinae_test(F f, Arg const& arg)
{
return f(arg);
}
template <typename F, typename Arg>
typename boost::result_of<F(Arg&)>::type
sfinae_test(F f, Arg& arg)
{
return f(arg);
}
int sfinae_test_f(int& i)
{
return i;
}
struct X {};
int main()
@@ -268,5 +289,10 @@ int main()
#endif
#endif
#if defined(BOOST_RESULT_OF_USE_DECLTYPE)
int i = 123;
sfinae_test(sfinae_test_f, i);
#endif // defined(BOOST_RESULT_OF_USE_DECLTYPE)
return 0;
}