mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-29 23:51:26 +00:00
Implement full support for non-pointer pointers in custom allocators for string. This completes the custom pointer support for the entire library.
llvm-svn: 185167
This commit is contained in:
1 parent
e852add40e
commit
eec721826c
151 files changed
+5125
-645
No files matched your search
@@ -15,6 +15,7 @@
|
||||
#include <cassert>
|
||||
|
||||
#include "../test_allocator.h"
|
||||
#include "../min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
void
|
||||
@@ -29,9 +30,20 @@ test(S s1, 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(3));
|
||||
test(S("1"), A(5));
|
||||
test(S("1234567890123456789012345678901234567890123456789012345678901234567890"), A(7));
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef min_allocator<char> A;
|
||||
typedef std::basic_string<char, std::char_traits<char>, A> S;
|
||||
test(S(), A());
|
||||
test(S("1"), A());
|
||||
test(S("1234567890123456789012345678901234567890123456789012345678901234567890"), A());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
Reference in new issue
Block a user