forked from boostorg/smart_ptr
Add get_allocator_pointer
This commit is contained in:
1 parent
8f40bff2f6
commit
6716193d9c
4 files changed
+279
-2
No files matched your search
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2019 Glen Joseph Fernandes
|
||||
Copyright 2019-2021 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
@@ -477,6 +477,15 @@ allocate_unique(const A& alloc,
|
||||
return c.release();
|
||||
}
|
||||
|
||||
template<class T, class U, class A>
|
||||
inline typename allocator_pointer<typename allocator_rebind<A,
|
||||
typename detail::sp_alloc_value<T>::type>::type>::type
|
||||
get_allocator_pointer(const std::unique_ptr<T,
|
||||
alloc_deleter<U, A> >& p) BOOST_NOEXCEPT
|
||||
{
|
||||
return p.get().ptr();
|
||||
}
|
||||
|
||||
} /* boost */
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user