mirror of
https://github.com/boostorg/smart_ptr.git
synced 2026-04-19 16:18:40 +02:00
Do not use components removed in C++17 (auto_ptr, binary_function)
This commit is contained in:
@@ -16,8 +16,11 @@
|
||||
#include <boost/scoped_array.hpp>
|
||||
#include <boost/intrusive_ptr.hpp>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
template<class T, class U> void assert_same_type( T** pt = 0, U** pu = 0 )
|
||||
{
|
||||
pt = pu;
|
||||
@@ -58,12 +61,16 @@ int main()
|
||||
assert_same_type< boost::pointer_to_other< boost::intrusive_ptr<X>, void >::type, boost::intrusive_ptr<void> >();
|
||||
assert_same_type< boost::pointer_to_other< boost::intrusive_ptr<void>, Y >::type, boost::intrusive_ptr<Y> >();
|
||||
|
||||
#if !defined( BOOST_NO_AUTO_PTR )
|
||||
|
||||
// auto_ptr
|
||||
|
||||
assert_same_type< boost::pointer_to_other< std::auto_ptr<X>, Y >::type, std::auto_ptr<Y> >();
|
||||
assert_same_type< boost::pointer_to_other< std::auto_ptr<X>, void >::type, std::auto_ptr<void> >();
|
||||
assert_same_type< boost::pointer_to_other< std::auto_ptr<void>, Y >::type, std::auto_ptr<Y> >();
|
||||
|
||||
#endif
|
||||
|
||||
// raw pointer
|
||||
|
||||
assert_same_type< boost::pointer_to_other< X *, Y >::type, Y * >();
|
||||
|
||||
Reference in New Issue
Block a user