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
|
||||
@@ -25,10 +26,22 @@ test(const S& s, const typename S::allocator_type& a)
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
typedef test_allocator<char> A;
|
||||
typedef std::basic_string<char, std::char_traits<char>, A> S;
|
||||
test(S(""), A());
|
||||
test(S("abcde", A(1)), A(1));
|
||||
test(S("abcdefghij", A(2)), A(2));
|
||||
test(S("abcdefghijklmnopqrst", A(3)), A(3));
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef min_allocator<char> A;
|
||||
typedef std::basic_string<char, std::char_traits<char>, A> S;
|
||||
test(S(""), A());
|
||||
test(S("abcde", A()), A());
|
||||
test(S("abcdefghij", A()), A());
|
||||
test(S("abcdefghijklmnopqrst", A()), A());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user