Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by alcover

3 months ago

Hello, your doc about const says "The const qualifier is only retained for actual constant variables".

Then how do you express read-only pointers ? Like C `const int* ptr`

1 comment

alcover

Reply

lerno  3 months ago

If you pass them as parameters, then there are in/out/inout annotations to limit usage. But other than that, there isn't anything.

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities