Closed DyXel closed 1 week ago
Sounds good.
Thanks! Done. I still like the explicit _
and will probably write that in my own code, but what pushed me over the edge is that this is a repeated request (thanks @gregmarr for reminding us about #190) and others seems to agree (thanks @MaxSagebaum)... and it doesn't appear to destabilize anything, it just requires actually removing the check.
FYI see #1138
This change would make the following compile:
outputs:
Will your feature suggestion eliminate X% of security vulnerabilities of a given kind in current C++ code? No.
Will your feature suggestion automate or eliminate X% of current C++ guidance literature? No. Maybe for cpp2 itself? I am just surprised that just
const
doesn't work even though_
is already the default.Describe alternatives you've considered. I added the
_
as the compiler demanded, but guess what, I added it to the wrong side since I am so used to east-const š The reason I added theconst
to begin with was because I wanted to quickly check if the function was mutating my variable down below quickly, but got this error instead, this causes friction when iterating code.*What about pointers ()?** I am not sure. There's a clang-tidy fix-it that automatically adds the pointer to
auto
for readability: readability-qualified-auto which seems to indicate some developers like this style?Personally I don't think that
my_pointer: * = something&
would be more readable, it doesn't seem that way to me, it just seems redundant. I also don't know if allowing that would help meta/generation (like having trailing commas do).