• Forum
  • Lounge
  • Looking for C++ projects and exercises o

 
Looking for C++ projects and exercises on polymorphism and ...

Hi,I have recently learned about polymorphism and templates in C++ and I am looking for some projects to practice more. Do you know any projects which I can take and are helpful for me?
I have recently learned about polymorphism and templates in C++

Do you mean compile-time polymorphism (aka "Generic Programming") or run-time polymorphism and basic template usage?
Anyways, projects usually aren't about any special programming paradigm, they just /use/ it. E.g., boost uses generic programming extensively (cf. e.g. "C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond"), so does CGAL, the Computational Geometry Algorithms Library (which is, in my oppinion, a masterpiece of generic library design with for mor specialized topics than, say the stl). However, they are about generic containers/algorithms and computational geometry, respectively, not *about* generic programming, though you would undoubtedly learn more about it along the way of participating (of course, both projects are pretty advanced, so perhaps not the right place for a beginner to start. Then again, as long as you play with the code on your own, this might give you insights in advanced techniques).
So, the question really is: what topic are you interested in? Generic/Object-Oriented programming are just tools, projects are built with these tools, but their usage is not the project's purpose.
Thank you for your explanation. I think I have to elaborate more. I have been learning C++ for 2 years . Recently, I learned what a template is and how you can define and use it and how you can use polymorphism ( virtual methods, abstract classes , etc.) to write an efficient program. My problem is, I have just read about them and I haven't used them anywhere. So I was wondering if anyone knows where I can find some relative exercises or kind of projects in which you have to use these things, so that I can work with the things I have learned and master them.
For a better understanding of templates, what they can be used for and how, you might want to implement you own container for a generic type. Before doing that, I recommend reading the book "Generic Programming and the STL". Though being partly pre-standard (everything is correct, but it contains deprecated comments on the "current implementation", which is not so current anymore...), it is still very good if you already know C++ quite well (it contains a complete reference of all concepts and requirements for any stl class & algorithm, as well as the explanation why anything is done the way it is by motivating examples in the introduction). However, it is somewhat advanced (from the foreword: "[...] it is neither an introductory textbook on algorithms nor a C++ tutorial. [...] This should not be your first C++ book, nor should it be your first exposure to an analysis of algorithms"). As the book states, "to use the stl is to extend it", so it is a recommendation even if you don't want to write your own container or algorithm explicitly right now.

For OO, you might want to browse through the "Design Patterns" by Gamma et al. Even if the book is written for software-engineers (who already know one or two things about software engineering...), you can get many ideas what you can do with classes and objects even if the former subject is of little interest for you.
Thank you! It was helpful!
Topic archived. No new replies allowed.