Skip to content

Vector<T>.Inequality operator documentation seems incorrect #11957

@Timovzl

Description

@Timovzl

Describe the issue or suggestion

Vector's inequality operator documentation appears incorrect: "Returns a value that indicates whether any single pair of elements in the specified vectors is equal." (emphasis mine)

Rather, we would expect: "Returns a value that indicates whether any single pair of elements in the specified vectors is unequal."

We can base this expectation on both common sense (inequality means there is something unequal between the operands) and the corresponding equality operator documentation: "Returns a value that indicates whether each pair of elements in two specified vectors are equal."

If == indicates whether each pair is equal, then != should indicate whether the opposite is true, i.e. whether there is any pair that is unequal.

My assumption here is that only the documentation of != is incorrect, and not its behavior, although I have not tested this.

The impact of the current documentation could be that developers opt for !(a == b) just to make sure they get the intended behavior.

Side note

The equality operator documentation could be improved when it comes to grammar: "whether each pair [...] are equal" should be "whether each pair [...] is equal".

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area ownersuntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions