Add noinit_adapt() free function utility

This commit is contained in:
Glen Fernandes
2019-04-29 00:23:59 -04:00
parent 50491408b1
commit a0e1100421
3 changed files with 47 additions and 39 deletions

View File

@@ -34,8 +34,7 @@ initialization of elements of a trivial type, which are later assigned values.
int main()
{
std::vector<int,
boost::noinit_adaptor<std::allocator<int> > > v(5);
std::vector<int, boost::noinit_adaptor<std::allocator<int> > > v(5);
std::iota(v.begin(), v.end(), 1);
}
```
@@ -136,6 +135,15 @@ const noinit_adaptor<U>& rhs) noexcept;`]
[endsect]
[section Free functions]
[variablelist
[[`template<class A> noinit_adaptor<A> noinit_adapt(const A& a) noexcept;`]
[[variablelist
[[Returns][`noinit_adaptor<A>(a)`.]]]]]]
[endsect]
[endsect]
[endsect]