CXXGraph icon indicating copy to clipboard operation
CXXGraph copied to clipboard

"Const" code review

Open AlfredCP opened this issue 4 years ago • 2 comments

Following the "const whenever is possible" principle, I would suggest to add this restriction to our code in places where we want our structures not to change and force them to stay untouchable.

Already commented in @ZigRazor PR

AlfredCP avatar Oct 30 '21 08:10 AlfredCP

@AlfredCP Did your previous PR resolve this or does this need more work ?

sidml avatar Nov 08 '21 02:11 sidml

No, I did not do it. With this task I was refering to:

  • make functions "const" if they can/should.
  • Pass functions arguments as const if they can/should
  • Make critical objects const if they should not change throught a function even if they are local.

So in the end, this task would be to go through all code and check for this elements to make the code more robust.

AlfredCP avatar Nov 08 '21 07:11 AlfredCP