STL中使用的设计模式(标准模板库) [英] design patterns used in STL(standard template library)

查看:1099
本文介绍了STL中使用的设计模式(标准模板库)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习STL和设计模式。
i想知道是否有任何解释如何在STL中实现设计模式的文档或链接
i是google但不能获得大量数据

I am learning STL and design patterns . i wanted to know is there any document or link that explains how design patterns are implemented in STL i did the google but not able to get much data

推荐答案

我希望你的意思是哪些设计模式可以在STL中识别。

I hope you mean, "which design patterns can be identified in the STL".

STL堆栈是一个容器适配器。适配器是一种设计模式。迭代器也是一种设计模式。

The STL stack is a container adapter. An adapter is a design pattern. The iterator is also a design pattern. The STL function objects are related to the command pattern.

模式:


  1. 适配器(容器适配器)

    • 堆栈

    • 队列

    • 优先队列


  • 反向迭代器

  • 插入迭代器

  • >
  • reverse iterators
  • insert iterators
  • stream iterators

这些模式的实现方式与面向对象设计中的实现方式截然不同。 Josuttis写道:STL概念与面向对象编程的最初想法相矛盾。这是导致您的问题的混乱。

The way these patterns are implemented is very different from the way they are implemented in an object oriented design. Josuttis wrote "the STL concept contradicts the original idea of object-oriented programming". This is what is causing the confusion around your question.

这篇关于STL中使用的设计模式(标准模板库)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆