This repo includes a header-only implementation of a shared pointer similar to the one provided by C++'s STL.
This is a header only library meaning you could take the header
shared_ptr/include/memory/shared_ptr.hpp
and
integrate it into your project. That said, it may be useful to build, run, and
experiment with the unit tests.
To build, you will need the following libraries and tools installed:
- CMake3.27+
- C++ compiler supporting C++20 features
To build and run the unit tests:
-
Change directory to the
shared_ptr/scripts/
directory. -
Run the build script:
./build.sh [DEBUG]
-
Navigate to the
shared_ptr/build/
. -
Run CTest:
ctest