C++ std::shared_ptr implementation for fun!
rps::shared_ptr is for educational purposes. It's syntax is mostly identical prior to C++17. This library doesn't support aliasing constructor, relations with other types of rps::shared_ptrs, relation with unique_ptr and relation with weak_ptr.
using namespace rps;
shared_ptr<int> ptr(new int(7));
shared_ptr<int> array_ptr(new int[10], default_delete<int[]>());
- rps::shared_ptr directly uses 8-bit whereas std::shared_ptr uses 16-bit.
- Light-weight, so faster.
- Names are descriptive so it is easier to follow and learn.
- rps::shared_ptr uses same syntax as std::shared_ptr to use it quickly.
- Clone this repository to your project.
#include <repelliuss/shared_ptr>
and you are good to go.