Use boost::noinit_adapt free function

This commit is contained in:
Glen Fernandes
2019-04-29 00:37:55 -04:00
parent 442e179920
commit 5072045f12
2 changed files with 4 additions and 6 deletions

View File

@ -172,7 +172,7 @@ inline typename enable_if_<is_unbounded_array<T>::value,
local_shared_ptr<T> >::type local_shared_ptr<T> >::type
allocate_local_shared_noinit(const A& allocator, std::size_t count) allocate_local_shared_noinit(const A& allocator, std::size_t count)
{ {
return boost::allocate_local_shared<T>(boost::noinit_adaptor<A>(allocator), return boost::allocate_local_shared<T>(boost::noinit_adapt(allocator),
count); count);
} }
@ -181,8 +181,7 @@ inline typename enable_if_<is_bounded_array<T>::value,
local_shared_ptr<T> >::type local_shared_ptr<T> >::type
allocate_local_shared_noinit(const A& allocator) allocate_local_shared_noinit(const A& allocator)
{ {
return boost::allocate_local_shared<T>(boost:: return boost::allocate_local_shared<T>(boost::noinit_adapt(allocator));
noinit_adaptor<A>(allocator));
} }
} /* boost */ } /* boost */

View File

@ -457,15 +457,14 @@ template<class T, class A>
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
allocate_shared_noinit(const A& allocator, std::size_t count) allocate_shared_noinit(const A& allocator, std::size_t count)
{ {
return boost::allocate_shared<T>(boost::noinit_adaptor<A>(allocator), return boost::allocate_shared<T>(boost::noinit_adapt(allocator), count);
count);
} }
template<class T, class A> template<class T, class A>
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
allocate_shared_noinit(const A& allocator) allocate_shared_noinit(const A& allocator)
{ {
return boost::allocate_shared<T>(boost::noinit_adaptor<A>(allocator)); return boost::allocate_shared<T>(boost::noinit_adapt(allocator));
} }
} /* boost */ } /* boost */