So either do something like
using MyStructType something = new MyStructType ()
myVar.WithXYZResource(res => { /* .... */ })
This from C# point of view, in something like D, there would be another set of considerations.
Still much easier than "in your face ownership management" though, yes.
So either do something like
Or a more FP like stuff with And then consider if it should be a ref struct, so that is only stack allocated.This from C# point of view, in something like D, there would be another set of considerations.
Still much easier than "in your face ownership management" though, yes.