From c6f1cf79c68ab2e621cb058e5e73db83b293fd09 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Fri, 27 May 2016 08:38:54 +0100 Subject: [PATCH] Fix tests --- forward/test/forward_adapter.cpp | 9 ++++++++- forward/test/lightweight_forward_adapter.cpp | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/forward/test/forward_adapter.cpp b/forward/test/forward_adapter.cpp index 2317ce7..09cef7e 100644 --- a/forward/test/forward_adapter.cpp +++ b/forward/test/forward_adapter.cpp @@ -44,6 +44,10 @@ public: { return -(l=r+val); } + char operator()(int& l, int& r) + { + return l=r+val; + } template struct result @@ -89,8 +93,11 @@ int main() // lvalue,lvalue BOOST_TEST(( is_same< result_of< f(int&, int&) >::type, char >::value )); + // result_of works differently for C++11 here, so compare + // with using it against test_func. BOOST_TEST(( is_same< - result_of< f const (int&, int&) >::type, char >::value )); + result_of< f const (int&, int&) >::type, + result_of< test_func<> const (int&, int&)>::type >::value )); } { diff --git a/forward/test/lightweight_forward_adapter.cpp b/forward/test/lightweight_forward_adapter.cpp index 7b0d304..dbd0f3f 100644 --- a/forward/test/lightweight_forward_adapter.cpp +++ b/forward/test/lightweight_forward_adapter.cpp @@ -44,6 +44,10 @@ public: { return -(l=r+val); } + char operator()(int & l, int & r) + { + return l=r+val; + } template struct result @@ -91,8 +95,11 @@ int main() // lvalue,lvalue BOOST_TEST(( is_same< result_of< f(ref, ref) >::type, char >::value )); + // result_of works differently for C++11 here, so compare + // with using it against test_func. BOOST_TEST(( is_same< - result_of< f const (ref, ref) >::type, char >::value )); + result_of< f const (ref, ref) >::type, + result_of< test_func<> const (int&, int&) >::type >::value )); } { using boost::noncopyable;