|
|
|
|
|
by comex
877 days ago
|
|
Many of the principles here align with my tastes, such as focusing on fast compile times and supporting allocation failure. On the other hand: > Unplanned Features: > SharedPtr > UniquePtr > In Principles there is a rule that discourages allocations of large number of tiny objects and also creating systems with unclear or shared memory ownership. For this reason this library is missing Smart Pointers. I don’t like that at all. I take the common view that all heap objects should at least be allocated via smart pointers. Doing so is safer and easier and usually zero-overhead. After allocation, it may be necessary to pass those objects via raw pointers/references, but smart pointers should be used where appropriate. So while I agree that it’s undesirable to allocate “large numbers of tiny objects”, I would want smart pointers as long as there’s any dynamic allocation at all. |
|
Regarding UniquePtr<T> I used to have one but I later on decided to remove it.
https://github.com/Pagghiu/SaneCppLibraries/commit/9149e28
However, that being said the library is lean enough so that you can still use it with smart pointers provided by any other library (including the standard one) if that's your preference.