Author |
Topic |
|
pocruadhlaoich
Senior Member
Ireland
43 Posts |
Posted - Sep 27 2017 : 09:40:23 AM
|
Hi, the code inspection feature "Zero constant can be replaced with nullptr" is very useful. Is it possible to customise the action it performs so that it will place the constant on the left?
if (0 == pBlah) if (pBlah == 0)
would be replaced with
if (nullptr == pBlah)
Currently the replace will happen in situ but it would be great to further improve the change to adhere to local coding standards. Thanks, Patrick |
Edited by - pocruadhlaoich on Sep 27 2017 09:41:06 AM |
|
feline
Whole Tomato Software
United Kingdom
19022 Posts |
Posted - Sep 27 2017 : 10:53:58 AM
|
An interesting thought, I have put in a feature request to see what our developers make of this. Generally we are wary of getting to much into code formatting / coding standards, since there are so many different standards and rules, it would lead to a mass of options. Still, this one does make a lot of sense. |
zen is the art of being at one with the two'ness |
|
|
pocruadhlaoich
Senior Member
Ireland
43 Posts |
Posted - Sep 27 2017 : 12:50:29 PM
|
Cool, thanks feline. Please let me know of any updates! |
|
|
zzdev10
New Member
USA
6 Posts |
Posted - Oct 20 2017 : 1:19:43 PM
|
I'd like to add a vote for this feature. It would be very useful if if code inspection was detecting and correcting cases like if( 0 == pBlah ). |
zzdev |
|
|
feline
Whole Tomato Software
United Kingdom
19022 Posts |
Posted - Oct 21 2017 : 09:51:42 AM
|
Oops, I forgot to include the case number for the feature request:
case=111349
zzdev10, this feature request is specific to changes made to your code by Code Inspection, rather than checking for checks where the constant value is on the left hand side.
I have put in a feature request to check for this in general, since it seems a fair point:
case=111878 |
zen is the art of being at one with the two'ness |
|
|
pocruadhlaoich
Senior Member
Ireland
43 Posts |
Posted - Sep 19 2018 : 08:06:51 AM
|
Is there any update on this feature request please? |
|
|
feline
Whole Tomato Software
United Kingdom
19022 Posts |
Posted - Sep 20 2018 : 5:02:34 PM
|
Unfortunately no progress on this yet, but it is still in our list of feature requests, so we are aware of this and have not forgotten about it. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|