Fix "-Wdeprecated-copy" warnings

This commit is contained in:
Ion Gaztañaga
2020-08-09 23:21:46 +02:00
parent 06417de498
commit 974e8e641a
8 changed files with 118 additions and 83 deletions
+12 -10
View File
@@ -30,6 +30,10 @@ public:
recursive_slist &operator=(const recursive_slist &o)
{ slist_ = o.slist_; return *this; }
recursive_slist (const recursive_slist &o)
: slist_(o.slist_)
{}
};
void recursive_slist_test()//Test for recursive types
@@ -262,24 +266,22 @@ int main ()
typedef boost::container::slist<int> cont;
typedef cont::allocator_type allocator_type;
typedef boost::container::allocator_traits<allocator_type>::pointer pointer;
if (boost::has_trivial_destructor_after_move<cont>::value !=
BOOST_STATIC_ASSERT_MSG(
!(boost::has_trivial_destructor_after_move<cont>::value !=
boost::has_trivial_destructor_after_move<allocator_type>::value &&
boost::has_trivial_destructor_after_move<pointer>::value) {
std::cerr << "has_trivial_destructor_after_move(default allocator) test failed" << std::endl;
return 1;
}
boost::has_trivial_destructor_after_move<pointer>::value)
, "has_trivial_destructor_after_move(default allocator) test failed");
}
// std::allocator
{
typedef boost::container::slist<int, std::allocator<int> > cont;
typedef cont::allocator_type allocator_type;
typedef boost::container::allocator_traits<allocator_type>::pointer pointer;
if (boost::has_trivial_destructor_after_move<cont>::value !=
BOOST_STATIC_ASSERT_MSG(
!(boost::has_trivial_destructor_after_move<cont>::value !=
boost::has_trivial_destructor_after_move<allocator_type>::value &&
boost::has_trivial_destructor_after_move<pointer>::value) {
std::cerr << "has_trivial_destructor_after_move(std::allocator) test failed" << std::endl;
return 1;
}
boost::has_trivial_destructor_after_move<pointer>::value)
, "has_trivial_destructor_after_move(std::allocator) test failed");
}
return 0;