1 Star 0 Fork 0

Huaxiao Liang/design-patterns-cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Visitor

Visitor represents an operation to be performed on the elements of an object structure. It lets you define a new operation without changing the classes of the elements on which it operates. The pattern has behavioral purpose and applies to the objects.

When to use

  • an object structure contains many classes of objects with differing interfaces, and you want to perform operations on these objects that depend on their concrete classes
  • many distinct and unrelated operations need to be performed on objects in an object structure, and you want to avoid "polluting" their classes with these operations
  • the classes defining the object structure rarely change, but you often want to define new operations over the structure
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/banana33/design-patterns-cpp.git
git@gitee.com:banana33/design-patterns-cpp.git
banana33
design-patterns-cpp
design-patterns-cpp
master

搜索帮助