profile-img
์ง€๋ฐ์ด์˜ ํ‹ฐ์Šคํ† ๋ฆฌ
images/slide-image

< STL > 

- Standard Template Library (STL) : library of classes and associated functions 

- ํ•œ๊ตญ์–ด๋กœ๋Š” ํ‘œ์ค€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ผ๊ณ  ํ•œ๋‹ค. 

- template-based components ๋ฅผ ํ†ตํ•ด software reuse์„ ํ•จ.  -> ์ด๋Š” ํƒ€์ž…์˜ ์ผ๋ฐ˜ํ™”๋กœ ๋งํ•  ์ˆ˜์žˆ์Œ 

: which is "GENERIC PROGRAMMING ! " ( vs functional programming - ํ•จ์ˆ˜ํ˜• ํ”„๋กœ๊ทธ๋ž˜๋ฐ) 

 

<STL ์˜ ๊ตฌ์„ฑ์š”์†Œ> 

1. Containers : ์ปจํ…Œ์ด๋„ˆ 

- Data structures capable of storing objects of almost any data type (there are some restrictions) 

- ํ”ํžˆ stl ์ž๋ฃŒ๊ตฌ์กฐ๋ผ๋Š” ๊ฒƒ์ด stl container์œผ๋กœ ํ†ต์šฉ๋œ๋‹ค. (์ปฌ๋ ‰์…˜์ด๋ผ ์นญํ•˜๋Š” ๊ฒฝ์šฐ๋„ ์žˆ์Œ) 

 

2. Iterators ( -> objects) : ๋ฐ˜๋ณต์ž 

- Used to step through the elements of a container

- ํฌ์ธํ„ฐ ๊ฐ™์€๊ฑฐ 

 

3. Algorithms ( = non-member functions) : ์•Œ๊ณ ๋ฆฌ์ฆ˜ 

- Functions that perform common data maniputation such as sorting, searching, and comparing elements (or entire contatiners) 

- sorting, searching, comparing ๊ฐ™์€ ์ผ๋ฐ˜์ ์ธ ํ•ด๊ฒฐ๋ฐฉ๋ฒ•์„ ๊ทœ๊ฒฉํ™” - ํ˜•์‹ํ™” ํ•ด๋†“์€ ๋ฐฉ๋ฒ•?? 

 

<STL ์˜ ์žฅ์ > 

- ๊ฐœ๊ฐ€ํ‹ฐ ๋น ๋ฅด๋‹ค 

- ์งœ์—ฌ์ ธ ์žˆ๋Š” ํ…œํ”Œ๋ฆฟ์„ ์ ์žฌ์ ์†Œ์— ๋„ฃ์œผ๋ฉด ๋˜๊ธฐ ๋•Œ๋ฌธ์— ํšจ์œจ์„ฑ์ด ๋ฌด์Ÿˆ๊ฒŒ ์˜ฌ๋ผ๊ฐ„๋‹ค 

 

.. ๋‹จ์ ์€ ์•„์ง ๋ชจ๋ฅด๊ฒŸ์Œ ใ…‹. ( ๊ทธ์น˜๋งŒ ์•„๋งˆ Generic programming์˜ ๋‹จ์ ์ด ๊ทธ๋Œ€๋กœ ๊ฐ€์ง€์•Š์„๊นŒ ํ•˜๋Š” ์ƒ๊ฐ์ด ๋“ ๋‹ค) 

 

 

 

๋‹ค์Œ์€ STL์˜ Iterator์— ๋Œ€ํ•ด์„œ ์•„๋ผ๋ณด์ž 

'เซฎโ‚หถแต” แต• แต”หถโ‚Žแƒโ™ก/coding' Related Articles +