Memory management: cast functions for managed pointers
Following up the discussion
C++ standard library extensions, here is the first MR
applying these definitions:
The cmext/memory
introduce helper functions to cast from managed types (like std::unique_ptr). These functions use same approach than the helper functions provided by <memory>
(std::static_pointer_cast
, etc...).
Moreover, I introduce some meta-programming for two reasons:
- To ensure the compiler will not try to instantiate the template with an invalid argument.
- To Increase flexibility: Any pointer wrapper offering method
get()
returning the managed pointer can be used to instantiate the template.
To use efficiently the meta-programming, I introduce also file cm/type_traits
.
Topic-rename: cmext-memory
Edited by Brad King