Skip to content

Discussion: class member functions should be const by default #30

Closed
@marzojr

Description

@marzojr

I know that class are still not supported on cppfront; but this makes the discussion even more relevant.

One of the things that lambda functions (arguably) get right is making their operator() const by default and requiring mutable if you want to change data from the lambda.

This should be done also for cpp2 classes. This has the advantages of (1) making lambdas less of a special case, and (2) making const-correct code the default.

This is kind of related to issue #25 .

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