Add more BOOST_CONTAINER_ATTRIBUTE_NODISCARD attributes and fix warnings triggered by this attribute

This commit is contained in:
Ion Gaztañaga
2025-12-18 15:23:56 +01:00
parent 8ce8b9ee43
commit ac523b2c1e
14 changed files with 76 additions and 26 deletions
+2 -1
View File
@@ -55,12 +55,13 @@ void test_allocate()
polymorphic_allocator<int> p(&d);
d.reset();
d.do_allocate_return = &dummy;
p.allocate(2);
int *const ptr = p.allocate(2);
BOOST_TEST(d.do_allocate_called == true);
BOOST_TEST(d.do_allocate_return == &dummy);
//It shall allocate 2*sizeof(int), alignment_of<int>
BOOST_TEST(d.do_allocate_bytes == 2*sizeof(int));
BOOST_TEST(d.do_allocate_alignment == dtl::alignment_of<int>::value);
p.deallocate(ptr, 2); //To make [[nodiscard]] happy
}
void test_deallocate()