Skip to content

Description of slice is misleading #124

Description

@slengfeld

The chapter about slices https://github.com/nrc/r4cppp/blob/master/arrays.md#slices uses wrong comparisons. It states

A slice in Rust is just an array whose length is not known at compile time.

But the rust documentation about slices says https://doc.rust-lang.org/std/slice/

A dynamically-sized view into a contiguous sequence, [T].

So a rust slice is similar to a C++ std:span https://en.cppreference.com/w/cpp/container/span and not similar to a rust array (a value) or to an C/C++ array (only a pointer).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions