mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-10-15 08:55:27 +02:00
Add fourth form of make_unique for objects
To support initialization syntax that Args&&... cannot forward perfectly.
This commit is contained in:
@@ -40,17 +40,7 @@ int main() {
|
||||
std::unique_ptr<int[][2]> a1 = boost::make_unique_noinit<int[][2]>(2);
|
||||
BOOST_TEST(a1.get() != 0);
|
||||
}
|
||||
|
||||
{
|
||||
std::unique_ptr<const int[]> a1 = boost::make_unique_noinit<const int[]>(3);
|
||||
BOOST_TEST(a1.get() != 0);
|
||||
}
|
||||
|
||||
{
|
||||
std::unique_ptr<const int[][2]> a1 = boost::make_unique_noinit<const int[][2]>(2);
|
||||
BOOST_TEST(a1.get() != 0);
|
||||
}
|
||||
|
||||
|
||||
BOOST_TEST(type::instances == 0);
|
||||
{
|
||||
std::unique_ptr<type[]> a1 = boost::make_unique_noinit<type[]>(3);
|
||||
@@ -72,7 +62,6 @@ int main() {
|
||||
BOOST_TEST(type::instances == 0);
|
||||
{
|
||||
std::unique_ptr<const type[]> a1 = boost::make_unique_noinit<const type[]>(3);
|
||||
const type* a2 = a1.get();
|
||||
BOOST_TEST(a1.get() != 0);
|
||||
BOOST_TEST(type::instances == 3);
|
||||
a1.reset();
|
||||
|
Reference in New Issue
Block a user