Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Machine{
- void makeIntersection(Machine const& other)
- virtual someFunc()=0;
- }
- class DFA: public Machine{
- }
- class NFA: public Machine{
- }
- // I WANT THIS FUNCTION TO HAVE THE ABILLITY, THAT 'Machine' CAN BE EVERY DERIVED CLASS WITHOUT WRITING THE METHOD SEPARETLY IN EVERY
- //DERIVED CLASS
- void Machine::makeIntersection(Machine const& other) //this is giving me an error because I can't construct an abstract class object
- {
- auto test = [this, other](std::string const& a, std::string const& b)->bool
- {
- if (this->isFinalState(a) && other.isFinalState(b))return true;
- return false;
- };
- this->makeStates(other, test);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement