4 ms·
I'm coming from a D perspective, where you really don't want to enforce anything single-owner-like, because it makes algorithms awkward. Neat does some commonse
by FeepingCreature 3y ago
I'm coming from a D perspective, where you really don't want to enforce anything single-owner-like, because it makes algorithms awkward. Neat does some commonsense optimizations to avoid pointless refcount changes, for instance it internally assumes that all function parameters are managed by the caller and doesn't take an additional reference for them. But at the end of the day, it mostly just refcounts and calls it good enough.
You can define types in Neat that are noncopyable, but it really limits what you can do with them. For instance, nested function references are noncopyable by default to avoid forcing closure allocations.