Update make_shared for arrays to conform to N3870

Update make_shared and allocate_shared for arrays to be confined to the
set of overloads specified in N3870.
This commit is contained in:
Glen Fernandes
2014-01-23 20:40:46 -08:00
parent a68db557e8
commit 630e4f49f3
31 changed files with 963 additions and 1841 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012 Glen Joseph Fernandes
* Copyright (c) 2012-2014 Glen Joseph Fernandes
* glenfe at live dot com
*
* Distributed under the Boost Software License,
@@ -14,12 +14,15 @@ class type
: public boost::enable_shared_from_this<type> {
public:
static unsigned int instances;
explicit type() {
instances++;
}
~type() {
instances--;
}
private:
type(const type&);
type& operator=(const type&);
@@ -38,6 +41,7 @@ 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);
@@ -48,5 +52,6 @@ int main() {
BOOST_TEST(type::instances == 3);
}
}
return boost::report_errors();
}