Hello I have problem in my school work
I try to pass in the "Board board" and the Color color to the the Move PlayeMove(const Board& board, Colour c) function, I declare inside struct Model:Concept and I not sure am I declare it correctly?
The following question is
1. Did I declare the 2 variable in correct position
2. How do I pass the 2 variable into player move function? should I pass it in
Model(U&& t)?
I appreciate give me some hint and maybe some tutorial I can follow, prefer with function that need to pass in parameter to call. I been searching online, most of the tutorial is calling const function that did not have any parameter.
Typically, the solution would be to introduce straightforward run-time polymorphism: both player classes would inherit from a single Player class, and implement a virtual function named Move.
Type erasure is a mechanism to unify static and run-time polymorphism. It allows you to homogenize types that each supply a similar interface, when those types are entirely unrelated - i.e., when they don't (or can't be made to) share a base class supplying that interface. It isn't a technique that you would ordinarily apply.
You'd pass the arguments to Player::PlayeMove when you call it.