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:46:09 UTC 2019


On Fri, Jan 18, 2019 at 07:08:02PM +0000, Neia Neutuladh via Digitalmars-d wrote:
> On Fri, 18 Jan 2019 13:47:15 -0500, Steven Schveighoffer wrote:
> > I'm not speaking about rules or restrictions, I'm talking about
> > stability. tempCString is pretty stable and likely won't change in
> > any way except implementation details.
> 
> It's low risk but entirely unsupported. Using it in your own private
> code is okay; you can choose when to switch compiler versions and so
> forth, and if it causes any issues, you can change it right away.
> Using it in code intended for other people to compile is not a great
> idea.

The best solution is just copy the code into your own module and use
that.  In this day and age there's a stigma against copy-pasted code,
but sometimes, that's exactly what the situation calls for.


T

-- 
They say that "guns don't kill people, people kill people." Well I think the gun helps. If you just stood there and yelled BANG, I don't think you'd kill too many people. -- Eddie Izzard, Dressed to Kill


More information about the Digitalmars-d mailing list