Skip to content
Discussion options

You must be logged in to vote

I probably wasn't too careful about it. For the most part it doesn't matter too much, with these two caveats:

  • If you can use static, you probably should. With static, there's only ever one copy of the data in the binary. With const, everything gets inlined at each use. That is, with const, you get no single fixed memory address for your data. But with static you do.
  • If you need to initialize a printer/parser in a const context, then use const.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tisonkun
Comment options

Answer selected by BurntSushi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants