Implement full support for non-pointer pointers in custom allocators for string. This completes the custom pointer support for the entire library.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185167 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <cassert>
|
||||
|
||||
#include "../test_allocator.h"
|
||||
#include "../min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
void
|
||||
@@ -36,6 +37,7 @@ test(S s)
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, test_allocator<char> > S;
|
||||
S s;
|
||||
test(s);
|
||||
@@ -45,4 +47,12 @@ int main()
|
||||
s.assign(100, 'a');
|
||||
s.erase(50);
|
||||
test(s);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
S s;
|
||||
assert(s.capacity() > 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user