On Monday, 5 June 2023 at 18:54:30 UTC, cc wrote:
>[...]
Is there a way to check for mutability as well? I have both immutable and mutable fields. I would like to generate setters for mutable fields only.
June 06, 2023 Re: How do I generate `setX` methods for all private mutable variables in a class? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Basile B. | On 6/6/23 09:13, Basile B. wrote: > yeah I know that opDispatch is disliked because it is tried in a SFINAE > fashion, as citicized by Adam. But on the other side it's the best opover. I like how it helped in my current project: user.someShellCommand("-foo", "-bar"); opDispatch makes a command string, passes it to executeShell, takes care of the return code and dumps its output if there was an error. Ali |
June 06, 2023 Re: How do I generate `setX` methods for all private mutable variables in a class? | ||||
---|---|---|---|---|
| ||||
Posted in reply to cc | On Monday, 5 June 2023 at 18:54:30 UTC, cc wrote: >[...] Is there a way to check for mutability as well? I have both immutable and mutable fields. I would like to generate setters for mutable fields only. |
June 06, 2023 Re: How do I generate `setX` methods for all private mutable variables in a class? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ki Rill | On Tuesday, 6 June 2023 at 21:49:58 UTC, Ki Rill wrote: >On Monday, 5 June 2023 at 18:54:30 UTC, cc wrote: >[...] Is there a way to check for mutability as well? I have both immutable and mutable fields. I would like to generate setters for mutable fields only. that's why a user attribute on the field is somewhat better than very complex introspection. It justs tells you "for that member do that". |