Merged revisions 81700,81703 from trunk:

Add overloads of make_shared and allocate_shared for arrays for E&& where E is typename boost::detail::array_base<T>::type
........
Update documentation and remove unused code.
........


[SVN r81716]
This commit is contained in:
Glen Fernandes
2012-12-05 04:28:20 +00:00
parent 3551d17566
commit 08e5894510
8 changed files with 203 additions and 16 deletions

View File

@@ -9,6 +9,17 @@
#include <boost/detail/lightweight_test.hpp>
#include <boost/smart_ptr/make_shared_array.hpp>
class type {
public:
type(int x, int y)
: x(x), y(y) {
}
const int x;
const int y;
private:
type& operator=(const type&);
};
int main() {
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
{
@@ -69,6 +80,22 @@ int main() {
BOOST_TEST(a1[1][1][0] == 2);
BOOST_TEST(a1[1][1][1] == 3);
}
#if defined(BOOST_HAS_RVALUE_REFS)
{
boost::shared_ptr<type[]> a1 = boost::make_shared<type[]>(4, {1, 2});
BOOST_TEST(a1[0].x == 1);
BOOST_TEST(a1[1].y == 2);
BOOST_TEST(a1[2].x == 1);
BOOST_TEST(a1[3].y == 2);
}
{
boost::shared_ptr<type[4]> a1 = boost::make_shared<type[4]>({1, 2});
BOOST_TEST(a1[0].x == 1);
BOOST_TEST(a1[1].y == 2);
BOOST_TEST(a1[2].x == 1);
BOOST_TEST(a1[3].y == 2);
}
#endif
#endif
return boost::report_errors();
}