I can crash program (core.exception.InvalidMemoryOperationError) by using __FUNCTION__ in a class ctor

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Jan 18 19:03:23 UTC 2019


On Fri, Jan 18, 2019 at 11:37:02AM -0700, Jonathan M Davis via Digitalmars-d wrote:
[...]
> The safest thing for anyone wanting to use std.internal.cstring is to
> just copy the module into their own project, though arguably, it's one
> of those things that should be cleaned up and made public instead of
> being in internal (which would actually break any code currently using
> std.internal.cstring). Regardless, I would definitely _not_ advise
> anyone to just import something from internal, and I definitely don't
> want to see anyone trying to argue later that we can't change
> something from internal just because a bunch of people decided that
> something from there was useful and started importing it. While the
> risk of your code breaking later on because it's using something from
> internal _might_ be low, it is basically begging for it to be broken
> at some point.
[...]

Shouldn't std.internal.* declare all symbols as private to std.*, like
with `package` or something? Or is that not expressible currently?

It's a pretty bad idea for user code to depend on std.internal.*...


T

-- 
Philosophy: how to make a career out of daydreaming.


More information about the Digitalmars-d mailing list