> Design Patterns > Visitor > Visitor Design Pattern In C++

Visitor Design Pattern In C++

Visitor design pattern in C++ to perform operation on elements of an object structure.


Visitor design pattern In C++

Output

ConcreteElementA::Accept()
ConcreteVisitor1::VisitConcreteElementA()
ConcreteElementA::Accept()
ConcreteVisitor2::VisitConcreteElementA()
ConcreteElementB::Accept()
ConcreteVisitor1::VisitConcreteElementB()
ConcreteElementB::Accept()
ConcreteVisitor2::VisitConcreteElementB()


Suresh Kumar Srivastava is founder of online learning site coursegalaxy.com and author of popular books C In Depth, Data Structures Through C In Depth. He has 18+ years experience in industry and worked on architecture and design of multiple products. This article Visitor Design Pattern In C++ is from his Design Patterns course.