3 ms·
Which RAII principle would you say would be broken in this scenario?
by einpoklum 7y ago
Which RAII principle would you say would be broken in this scenario?
- flatline 7y agoIf the lifetime of your objects are not bound to any scope, I’d say you’re well out of the realm of any real benefit that RAII would provide over GC. This is a continual problem that arises with a shared ownership model. The specific principle this violates is encapsulation - there is still encapsulation at the level of the smart pointer, but not with its consumers.