Use a local copy of is_same trait.

boost::core::is_same is deprecated, so use a local copy to avoid adding
a dependency on Boost.TypeTraits. Use Boost.TypeTraits in tests.

Also added a missing include.
This commit is contained in:
Andrey Semashev
2022-12-23 01:59:28 +03:00
parent cbd61ba5b9
commit 9493eaccad
7 changed files with 64 additions and 27 deletions
+1 -1
View File
@@ -6,6 +6,6 @@ include(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST)
if(HAVE_BOOST_TEST)
boost_test_jamfile(FILE Jamfile.v2 LINK_LIBRARIES Boost::bind Boost::core Boost::function Boost::smart_ptr)
boost_test_jamfile(FILE Jamfile.v2 LINK_LIBRARIES Boost::bind Boost::core Boost::function Boost::smart_ptr Boost::type_traits)
endif()
+3 -3
View File
@@ -4,12 +4,12 @@
#include <boost/bind/apply.hpp>
#include <boost/core/lightweight_test_trait.hpp>
#include <boost/core/is_same.hpp>
#include <boost/type_traits/is_same.hpp>
int main()
{
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<void, boost::apply<void>::result_type>));
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int&, boost::apply<int&>::result_type>));
BOOST_TEST_TRAIT_TRUE((boost::is_same<void, boost::apply<void>::result_type>));
BOOST_TEST_TRAIT_TRUE((boost::is_same<int&, boost::apply<int&>::result_type>));
return boost::report_errors();
}
+3 -3
View File
@@ -6,11 +6,11 @@
#include <boost/bind/protect.hpp>
#include <boost/core/lightweight_test_trait.hpp>
#include <boost/core/is_same.hpp>
#include <boost/type_traits/is_same.hpp>
template<class T, class F> void test( F )
{
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<typename T::result_type, typename F::result_type>));
BOOST_TEST_TRAIT_TRUE((boost::is_same<typename T::result_type, typename F::result_type>));
}
struct X
@@ -29,7 +29,7 @@ template<class T, class U> struct inherit: T, U
template<class F> void test2( F )
{
// test that F doesn't have ::result_type
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<typename inherit<F, X>::result_type, typename X::result_type>));
BOOST_TEST_TRAIT_TRUE((boost::is_same<typename inherit<F, X>::result_type, typename X::result_type>));
}
int main()