forked from boostorg/core
Add default_allocator allocate hint overload in C++03 mode
This commit is contained in:
@@ -211,6 +211,7 @@ run default_allocator_test.cpp
|
||||
<toolset>msvc:<warnings-as-errors>on
|
||||
<toolset>gcc:<warnings-as-errors>on
|
||||
<toolset>clang:<warnings-as-errors>on ;
|
||||
run default_allocator_allocate_hint_test.cpp ;
|
||||
|
||||
run noinit_adaptor_test.cpp ;
|
||||
run alloc_construct_test.cpp ;
|
||||
|
19
test/default_allocator_allocate_hint_test.cpp
Normal file
19
test/default_allocator_allocate_hint_test.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2021 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#include <boost/core/default_allocator.hpp>
|
||||
#include <boost/core/allocator_access.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
boost::default_allocator<int> a;
|
||||
int* p = boost::allocator_allocate(a, 1, 0);
|
||||
BOOST_TEST(p != 0);
|
||||
a.deallocate(p, 1);
|
||||
return boost::report_errors();
|
||||
}
|
Reference in New Issue
Block a user