Skip to content

Adopt C++20 defaulted comparisons (operator== / <=>) #1748

Description

@legendecas

Several node-addon-api types define operator== and operator!= as an explicit pair, where the != is always return !operator==(other);. In C++20 the compiler synthesizes a != b from operator==, so the hand-written != overloads become redundant and can be removed. Where the comparison is plain memberwise equality, operator== itself can be = defaulted.

Regarding <=>, the only plausible type is Maybe<T> where T is ordered.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    Need Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions