BigBahss / vscode-cmantic

C/C++ code generation for VS Code: Generate Definitions, Getters, Setters, and much more.
https://bigbahss.github.io/vscode-cmantic/
MIT License
83 stars 9 forks source link

Setter generation doesn't handle references properly #12

Closed grigorig closed 3 years ago

grigorig commented 3 years ago

The setter generator generates a declaration like void setSomething(const Something& &something) for a member of type Something&, which is a syntax error.

BigBahss commented 3 years ago

Thank you for letting me know, that's something I did not account for. I'll get that fixed.

BigBahss commented 3 years ago

Fixed on branch master, leaving this open until a release is published.

I also noticed generating a getter for a reference data member will return a reference. Since I don't have experience with using reference data members, is this typical? Or should it just return the value?

grigorig commented 3 years ago

It needs to return a reference as classes might have a deleted copy constructor.

BigBahss commented 3 years ago

Gotcha, thank you!

BigBahss commented 3 years ago

Fixed in v0.4.2