Opened 16 years ago
Closed 16 years ago
#122 closed task (fixed)
'Node' or 'const Node&' parameters
Reported by: | Peter Kovacs | Owned by: | Alpar Juttner |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | core | Version: | |
Keywords: | Cc: | ||
Revision id: |
Description
Which syntax should be used if a function needs a node/arc/edge parameter? Which one is better and why?
Node n, Arc a, Edge e
const Node &n, const Arc &a, const Edge &e
Change History (5)
comment:1 follow-up: 4 Changed 16 years ago by
comment:2 follow-up: 3 Changed 16 years ago by
Probably it is better to raise a topic like this on the mailing list first.
comment:3 Changed 16 years ago by
Replying to alpar:
Probably it is better to raise a topic like this on the mailing list first.
See comment:ticket:123:5.
comment:4 follow-up: 5 Changed 16 years ago by
Replying to alpar:
Probably they are equally good in virtually all cases.
Of course, the first form allows changing the parameter values, while the second one doesn't.
If there isn't any efficiency difference, this question is not important, and this ticket can be closed.
comment:5 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Replying to kpeter:
If there isn't any efficiency difference,
Hopefully there isn't. At least for inline functions there shouln't be.
I think it is rather a matter of programming style. It would be nice if we followed a uniform style in this question, but not really a problem if we do not.
this question is not important, and this ticket can be closed.
I do so.
Replying to kpeter:
Probably they are equally good in virtually all cases.