Add overloads of allocate_shared_noinit to complement make_shared_noinit

[SVN r81858]
This commit is contained in:
Glen Fernandes
2012-12-11 17:42:47 +00:00
parent 9863467152
commit ecceb710de
6 changed files with 202 additions and 2 deletions

View File

@@ -38,5 +38,15 @@ int main() {
BOOST_TEST(type::instances == 3);
}
}
BOOST_TEST(type::instances == 0);
{
boost::shared_ptr<type[]> a1 = boost::allocate_shared_noinit<type[]>(std::allocator<type>(), 3);
try {
a1[0].shared_from_this();
BOOST_ERROR("shared_from_this did not throw");
} catch (...) {
BOOST_TEST(type::instances == 3);
}
}
return boost::report_errors();
}