On Wednesday, 7 October 2015 at 00:17:37 UTC, bitwise wrote:
-again, alias this allows class references to escape their RAII containers and can cause access violations as show here:
http://forum.dlang.org/post/[email protected]

This isn't really a problem as it can be easily fixed. It's just that the original writer of Scoped made the mistake of allowing implicit conversion of a Scoped!C to a C, which when you think about it doesn't make any sense and is actually quite dangerous (as my post that you cited shows). All that has to be done to fix that is to disallow implicit conversion to the wrapped type while retaining the interface, which we can do today with a myriad of different methods (mixins, opDispatch, std.typecons.Proxy, etc.). It's just that nobody has done it.

Reply via email to