From cb6a0246dfa8de20f938dcd3320df54e83d1b059 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 21 Jan 2018 21:09:50 +0000 Subject: [PATCH] Test members in compile_test, rather than inheritance Inheritance from unary_function is deprecated in recent C++. Better to check the member types. Could probably drop test altogether. --- test/compile_time.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/compile_time.hpp b/test/compile_time.hpp index db6bc59..d7631b8 100644 --- a/test/compile_time.hpp +++ b/test/compile_time.hpp @@ -5,14 +5,16 @@ #include #include -#include +#include template void compile_time_tests(T*) { -#if !defined(_HAS_AUTO_PTR_ETC) || _HAS_AUTO_PTR_ETC - BOOST_STATIC_ASSERT((boost::is_base_and_derived< - std::unary_function, BOOST_HASH_TEST_NAMESPACE::hash >::value)); -#endif + BOOST_STATIC_ASSERT((boost::is_same::argument_type + >::value)); + BOOST_STATIC_ASSERT((boost::is_same::result_type + >::value)); }