const PRINTER vs. static PARSER
#401
-
|
In the code examples under Since both of them has a constant cc @BurntSushi |
Beta Was this translation helpful? Give feedback.
Answered by
BurntSushi
Aug 5, 2025
Replies: 1 comment 1 reply
-
|
I probably wasn't too careful about it. For the most part it doesn't matter too much, with these two caveats:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
BurntSushi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I probably wasn't too careful about it. For the most part it doesn't matter too much, with these two caveats:
static, you probably should. Withstatic, there's only ever one copy of the data in the binary. Withconst, everything gets inlined at each use. That is, withconst, you get no single fixed memory address for your data. But withstaticyou do.constcontext, then useconst.