mirror of
https://github.com/boostorg/core.git
synced 2025-07-30 04:47:24 +02:00
Update documentation for default_allocator
This commit is contained in:
@ -27,6 +27,19 @@ detects the absence of these members to provide more optimal construction.
|
|||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
|
[section Examples]
|
||||||
|
|
||||||
|
The following snippet shows the use of this allocator as the default allocator
|
||||||
|
for a container.
|
||||||
|
|
||||||
|
```
|
||||||
|
template<class Key, class Compare = std::less<Key>,
|
||||||
|
class Allocator = boost::default_allocator<Key> >
|
||||||
|
class FlatSet;
|
||||||
|
```
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
[section Reference]
|
[section Reference]
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -64,7 +77,7 @@ constexpr bool operator==(const default_allocator<T>&,
|
|||||||
const default_allocator<U>&) noexcept;
|
const default_allocator<U>&) noexcept;
|
||||||
|
|
||||||
template<class T, class U>
|
template<class T, class U>
|
||||||
constexpr operator!=(const default_allocator<T>&,
|
constexpr bool operator!=(const default_allocator<T>&,
|
||||||
const default_allocator<U>&) noexcept;
|
const default_allocator<U>&) noexcept;
|
||||||
|
|
||||||
} /* boost */
|
} /* boost */
|
||||||
@ -73,7 +86,6 @@ constexpr operator!=(const default_allocator<T>&,
|
|||||||
[section Members]
|
[section Members]
|
||||||
|
|
||||||
[variablelist
|
[variablelist
|
||||||
|
|
||||||
[[`constexpr std::size_t max_size() const noexcept;`]
|
[[`constexpr std::size_t max_size() const noexcept;`]
|
||||||
[[variablelist
|
[[variablelist
|
||||||
[[Returns][The largest value `N` for which the call `allocate(N)` might
|
[[Returns][The largest value `N` for which the call `allocate(N)` might
|
||||||
|
@ -12,9 +12,7 @@ Distributed under the Boost Software License, Version 1.0.
|
|||||||
#include <new>
|
#include <new>
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
|
||||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
#if defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 60000
|
||||||
#define BOOST_CORE_NO_CXX11_ALLOCATOR
|
|
||||||
#elif defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 60000
|
|
||||||
#define BOOST_CORE_NO_CXX11_ALLOCATOR
|
#define BOOST_CORE_NO_CXX11_ALLOCATOR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -122,7 +120,7 @@ struct default_allocator {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BOOST_CORE_NO_CXX11_ALLOCATOR)
|
#if defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_CORE_NO_CXX11_ALLOCATOR)
|
||||||
template<class U, class V>
|
template<class U, class V>
|
||||||
void construct(U* p, const V& v) {
|
void construct(U* p, const V& v) {
|
||||||
::new(p) U(v);
|
::new(p) U(v);
|
||||||
|
Reference in New Issue
Block a user