Skip to content

How to get rid of const in generated C/C++ code? #131

Closed Answered by pfusik
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

To mark methods as non-const, place an exclamation mark after method name:

public class Foo
{
    public void Bar!()
    {
        ...
    }
}

To mark object references as non-const, place an exclamation mark after class name:

Foo! ref;
Foo!? nullableRef;

To mark array references as non-const, place an exclamation mark after the pair of brackets:

int[]! arrayRef;
int[]!? nullableArrayRef;

For more complex references, such as reference to an array of object references, use an exclamation mark for every level:

Foo![]! objectRefArrayRef;

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant