Lexicographic comparison of arrays (of chars)

Jonathan M Davis newsgroup.d at jmdavisprog.com
Wed Jan 22 15:45:39 UTC 2020


On Wednesday, January 22, 2020 7:50:01 AM MST Per Nordlöw via Digitalmars-d-
learn wrote:
> On Wednesday, 22 January 2020 at 10:19:38 UTC, Jacob Carlborg
>
> wrote:
> > That looks like it's for internal use. There is a `compare`
> > method in the `TypeInfo` of each type.
>
> Will that incur an extra runtime cost compared to __cmp?

Regardless of the overhead involved, you really shouldn't be calling
functions that start with __ or any that are in an internal package. They're
not intended to be called directly by anything outside of druntime or
Phobos, and they could change at any time. In the case of
core.internal.array, the only reason that any of it is even exposed is
because it had to be when it was changed to a template.

- Jonathan M Davis






More information about the Digitalmars-d-learn mailing list