This is a first step in disallowing invalid structures from being created, to uphold the guarantees of sortedness of the structures.
This limits the surface where non-sortedness could appear by calling new_trusted. We could add debug assertations to new_trusted if we are paranoid.
Methods to test if invariants are upheld has been moved to the utils module. They could be useful for library users, and could be made public.
This is a first step in disallowing invalid structures from being created, to uphold the guarantees of sortedness of the structures. This limits the surface where non-sortedness could appear by calling
new_trusted
. We could add debug assertations tonew_trusted
if we are paranoid.Methods to test if invariants are upheld has been moved to the
utils
module. They could be useful for library users, and could be made public.