Skip to content

Limited support for const qualifier #73

Open
@jonas

Description

@jonas

Right now const is discarded, however, it should be possible to support its use in certain places, namely:

extern const int PI;
struct point { int x; int y; };
const struct point *get_cursor(void);
typedef bool (*visitor)(const struct point *point);

For variables (#70), the Scala definition should use val and for structs, one idea is to generate a separate type alias for const structs with an ops implicit class that does not contain the field_= methods. It would be nice to come up with an encoding that allows non-const structs to be assigned to a const version and disallow the inverse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bindgenBinding generatorrfcA proposal for a new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions