diff --git a/doc/noinit_adaptor.qbk b/doc/noinit_adaptor.qbk index 24edd26..a278135 100644 --- a/doc/noinit_adaptor.qbk +++ b/doc/noinit_adaptor.qbk @@ -71,8 +71,7 @@ struct noinit_adaptor : A { template struct rebind { - typedef noinit_adaptor::template - rebind_alloc > other; + typedef noinit_adaptor > other; }; noinit_adaptor() noexcept; @@ -86,9 +85,6 @@ struct noinit_adaptor template void construct(U* p); - template - void construct(U* p, V&& v, Args&&... args); - template void destroy(U* p); }; @@ -121,7 +117,7 @@ noinit_adaptor noinit_adapt(const A& a) noexcept; [[variablelist [[Requires][`A` shall be constructible from `U`.]] [[Effects][Initializes the `A` base class with -`static_cast(u)`.]]]]]] +`static_cast(u)`.]]]]]] [endsect] @@ -131,11 +127,6 @@ noinit_adaptor noinit_adapt(const A& a) noexcept; [[`template void construct(U* p);`] [[variablelist [[Effects][`::new((void*)p) U`.]]]]] -[[`template void construct(U* p, V&& v, -Args&&... args);`] -[[variablelist -[[Effects][`::new(void*)p) U(std::forward(v), -std::forward(args)...)`.]]]]] [[`template void destroy(U* p);`] [[variablelist [[Effects][`p->~U()`.]]]]]] diff --git a/include/boost/core/noinit_adaptor.hpp b/include/boost/core/noinit_adaptor.hpp index 22c9aab..13ce4c8 100644 --- a/include/boost/core/noinit_adaptor.hpp +++ b/include/boost/core/noinit_adaptor.hpp @@ -8,14 +8,7 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_CORE_NOINIT_ADAPTOR_HPP #define BOOST_CORE_NOINIT_ADAPTOR_HPP -#include -#if !defined(BOOST_NO_CXX11_ALLOCATOR) -#include -#endif -#include -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) -#include -#endif +#include namespace boost { @@ -24,12 +17,7 @@ struct noinit_adaptor : A { template struct rebind { -#if !defined(BOOST_NO_CXX11_ALLOCATOR) - typedef noinit_adaptor::template - rebind_alloc > other; -#else - typedef noinit_adaptor::other> other; -#endif + typedef noinit_adaptor::type> other; }; noinit_adaptor() @@ -43,39 +31,26 @@ struct noinit_adaptor template noinit_adaptor(const U& u) BOOST_NOEXCEPT : A(u) { } + + template + noinit_adaptor(U& u) BOOST_NOEXCEPT + : A(u) { } #endif template noinit_adaptor(const noinit_adaptor& u) BOOST_NOEXCEPT - : A(static_cast(u)) { } + : A(static_cast(u)) { } template void construct(U* p) { ::new((void*)p) U; } -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - template - void construct(U* p, V&& v, Args&&... args) { - ::new((void*)p) U(std::forward(v), std::forward(args)...); - } -#else - template - void construct(U* p, V&& v) { - ::new((void*)p) U(std::forward(v)); - } -#endif -#else +#if defined(BOOST_NO_CXX11_ALLOCATOR) template void construct(U* p, const V& v) { ::new((void*)p) U(v); } - - template - void construct(U* p, V& v) { - ::new((void*)p) U(v); - } #endif template