On Friday, 9 February 2018 at 15:03:02 UTC, Adam D. Ruppe wrote:
On Friday, 9 February 2018 at 14:59:38 UTC, Ralph Doncaster wrote:
The docs say using "private" will keep the symbol out of the file, but that is not true.

That sentence isn't well written since D's private and C's static are different... what D's private does is make the symbol invisible to other D files; when you import the module, it doesn't import the private names so it acts like they don't exist.

But they do still exist in the object file. I'm pretty sure C's statics do too actually just without an exported name...

Yes, C's "const static" will still create a symbol in the object file. I just checked with gcc5, and it creates a local readonly symbol "r".

My point is that in D, the docs say "private" will keep the definition out of the object file. I think you'll have to agree that it's at least confusing.

Reply via email to