r/learncpp • • Aug 07 '20

I implemented some Data Structures in C++

Not sure if this is the place for posting code, if it is not, I apologize.

I implemented some data structures in C++. I am somewhat new to C++ and started this project originally to get used to std::unique_ptr via a LinkedList implementation and then decided to add a few more data structures.

Note that I have yet to fix the postorder Traversal for the binary search tree.

I think that a lot of the iterators I wrote may be bad practice, which is why I would really appreciate some feedback / suggestions for this project.

https://github.com/PetrifiedPanda/DataStructures

8 Upvotes

13 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Aug 18 '20

If you're not using cmake it may make gtest easier to use. I haven't tried using them outside of cmake though so I can't say completely. I would just find something you can get working, there are header-only test libraries out there too.

I would definitely check the tests into github. It's also useful for anybody who wishes to contribute or fix bugs to have places to add them, and I look for the tests to find examples of how the lib is used.