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
I think that your problem is that design patterns are not implemented in STL. They can be implemented in C++ and use containers and algorithms from STL but STL and Design Patterns are not related in any other way.
My advice would be to learn about STL by reading something like Nicolai Josuttis' excellent book The C++ Standard Library: A Tutorial and Reference or STL Tutorial and Reference Guide. This will help in learning what the STL can do for you. Then dig into implementing design patterns in C++ using your knowledge about the STL.
I hope you mean, "which design patterns can be identified in the 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.
Patterns:
- Adapter (container adapters)
- stack
- queues
- priority queues
- Iterator
- Command + Adapter (function adapters)
- Iterator + Adapter (iterator adapters)
- reverse iterators
- insert iterators
- stream iterators
- Template Method (STL algorithms using user-specified functions)
- Which creational pattern? (Allocators)
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 makes extensive use of templates. GoF call this parameterized types. Templates are useful for customizing a design pattern solution or in coming up with a new, intuitive solution. (For more details, see the section "Inheritance versus Parameterized Types" in "Design Patterns: Elements of Reusable Object-Oriented Software"). The advantage of getting familiar with STL (and boost) is that they are a good source to learn about templates (and meta-programming) in C++, which in turn can be used in devising better designs.