This is part of a series found at on computerbytez.com.
In C++, Virtual Functions usually require a pointer or a reference. Sometimes, it'd just be a lot easier if we could pass objects by value to get these virtual functions.
This is not without its problems, but it can be done in C++11 or newer. Here is an example project explaining how
First, read the series. I have organized examples by week. These files should just work in any C++11 compiler (except for week 5 which requires C++17).
If you want to just start using virtual functions by value without knowing the theory behind them (not recommended), the includes/
folder has some template classes which will prove useful for using them right away.