Add more CTL content

This commit is contained in:
Justine Tunney 2024-06-28 19:07:35 -07:00
parent 38921dc46b
commit 021c53ba32
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
56 changed files with 1747 additions and 298 deletions

View file

@ -17,8 +17,11 @@
// PERFORMANCE OF THIS SOFTWARE.
#include "ctl/array.h"
#include "ctl/string.h"
#include "libc/mem/leaks.h"
// #include <array>
// #include <string>
// #define ctl std
int
@ -264,4 +267,21 @@ main()
if (rit != arr.rend())
return 4;
}
{
ctl::array<ctl::string, 2> A = { "hi", "theretheretheretherethere" };
if (A.size() != 2)
return 76;
if (A[0] != "hi")
return 77;
if (A[1] != "theretheretheretherethere")
return 78;
A = { "theretheretheretherethere", "hi" };
if (A[0] != "theretheretheretherethere")
return 79;
if (A[1] != "hi")
return 80;
}
CheckForMemoryLeaks();
}