Skip to content

Using in instead of ref? #57

Description

@Happypig375

There are many const T* parameters in Box2D. The easy way is to treat all of them as ref, i.e. not caring about the const part. However, this not only causes unnecessary friction when using the methods, such as the need to declare parameters on a separate line (you can just supply a value to an in parameter), but also loses the readonly intention of the pointer. It may be more correct to expose these pointers as in instead of ref.

Documentation on in vs ref: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/method-parameters#reference-parameters

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