Implement full support for non-pointer pointers in custom allocators for vector.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185093 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include <vector>
|
||||
#include <cassert>
|
||||
#include "../../test_allocator.h"
|
||||
#include "../../min_allocator.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -57,5 +58,20 @@ int main()
|
||||
assert(!l.empty());
|
||||
assert(l2.get_allocator() == other_allocator<bool>(4));
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
std::vector<bool, min_allocator<bool> > l(min_allocator<bool>{});
|
||||
std::vector<bool, min_allocator<bool> > lo(min_allocator<bool>{});
|
||||
for (int i = 1; i <= 3; ++i)
|
||||
{
|
||||
l.push_back(i);
|
||||
lo.push_back(i);
|
||||
}
|
||||
std::vector<bool, min_allocator<bool> > l2(std::move(l), min_allocator<bool>());
|
||||
assert(l2 == lo);
|
||||
assert(l.empty());
|
||||
assert(l2.get_allocator() == min_allocator<bool>());
|
||||
}
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
}
|
||||
|
Reference in New Issue
Block a user