cosmopolitan/test/ctl
Steven Dee (Jōshin) d7b1919b29
ctl::unique_ptr improvements and cleanup ()
Explicitly value-initializes the deleter, even though I have not found a
way to get the deleter to act like it’s been default-initialized in unit
tests so far.

Uses auto in reset. The static cast is apparently not needed (unless I’m
missing some case I didn’t think of.)

Implements the general move constructor - turns out that the reason this
didn’t work before was that default_delete<U> was not move constructible
from default_delete<T>.

Drop inline specifiers from functions defined entirely inside the struct
definition since they are implicitly inline.

* Cleans up reset to match spec

Remove the variants from the T[] specialization. Also follow the spec on
the order of operations in reset, which may matter if we are deleting an
object that has a reference to the unique_ptr that is being reset. (?)

* Tests Base/Derived reset.

* Adds some constexpr declarations.

* Adds default_delete specialization for T[].

* Makes parameters const.
2024-06-20 18:44:31 -04:00
..
.clang-format Introduce Cosmopolitan Templates Library (CTL) 2024-06-03 09:21:59 -07:00
BUILD.mk Make malloc() go 200x faster 2024-06-05 02:02:14 -07:00
optional_test.cc CTL: utility.h, use ctl::swap in string () 2024-06-19 01:00:59 -04:00
string_test.cc More ctl::string optimization () 2024-06-20 14:52:12 -04:00
string_view_test.cc CTL: utility.h, use ctl::swap in string () 2024-06-19 01:00:59 -04:00
unique_ptr_test.cc ctl::unique_ptr improvements and cleanup () 2024-06-20 18:44:31 -04:00
vector_test.cc CTL: utility.h, use ctl::swap in string () 2024-06-19 01:00:59 -04:00