DrawingProcess
λ“œν”„ DrawingProcess
DrawingProcess
전체 방문자
였늘
μ–΄μ œ
Β«   2025/07   Β»
일 μ›” ν™” 수 λͺ© 금 ν† 
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
  • λΆ„λ₯˜ 전체보기 (969)
    • Profile & Branding (25)
      • Career (18)
    • IT Trends (254)
      • Conference, Faire (Experien.. (31)
      • News (187)
      • Youtube (19)
      • TED (8)
      • Web Page (2)
      • IT: Etc... (6)
    • Contents (98)
      • Book (67)
      • Lecture (31)
    • Project Process (94)
      • Ideation (0)
      • Study Report (34)
      • Challenge & Award (22)
      • 1Day1Process (5)
      • Making (5)
      • KRC-FTC (Team TC(5031, 5048.. (10)
      • GCP (GlobalCitizenProject) (15)
    • Study: ComputerScience(CS) (72)
      • CS: Basic (9)
      • CS: Database(SQL) (5)
      • CS: Network (14)
      • CS: OperatingSystem (3)
      • CS: Linux (39)
      • CS: Etc... (2)
    • Study: Software(SW) (95)
      • SW: Language (29)
      • SW: Algorithms (1)
      • SW: DataStructure & DesignP.. (1)
      • SW: Opensource (15)
      • SW: Error Bug Fix (43)
      • SW: Etc... (6)
    • Study: Artificial Intellige.. (149)
      • AI: Research (1)
      • AI: 2D Vision(Det, Seg, Tra.. (35)
      • AI: 3D Vision (70)
      • AI: MultiModal (3)
      • AI: SLAM (0)
      • AI: Light Weight(LW) (3)
      • AI: Data Pipeline (7)
      • AI: Machine Learning(ML) (1)
    • Study: Robotics(Robot) (33)
      • Robot: ROS(Robot Operating .. (9)
      • Robot: Positioning (8)
      • Robot: Planning & Control (7)
    • Study: DeveloperTools(DevTo.. (83)
      • DevTool: Git (12)
      • DevTool: CMake (13)
      • DevTool: NoSQL(Elastic, Mon.. (25)
      • DevTool: Container (17)
      • DevTool: IDE (11)
      • DevTool: CloudComputing (4)
    • 인생을 μ‚΄λ©΄μ„œ (65)
      • λ‚˜μ˜ μ·¨λ―Έλ“€ (7)
      • λ‚˜μ˜ 생각듀 (42)
      • 여행을 λ– λ‚˜μž~ (10)
      • 뢄기별 회고 (6)

개발자 λͺ…μ–Έ

β€œ λ§€μ£Ό λͺ©μš”μΌλ§ˆλ‹€ 당신이 항상 ν•˜λ˜λŒ€λ‘œ μ‹ λ°œλˆμ„ 묢으면 μ‹ λ°œμ΄ ν­λ°œν•œλ‹€κ³  생각해보라.
컴퓨터λ₯Ό μ‚¬μš©ν•  λ•ŒλŠ” 이런 일이 항상 μΌμ–΄λ‚˜λŠ”λ°λ„ 아무도 λΆˆν‰ν•  생각을 μ•ˆ ν•œλ‹€. ”

- Jef Raskin

λ§₯의 아버지 - μ• ν”Œμ»΄ν“¨ν„°μ˜ λ§€ν‚¨ν† μ‹œ ν”„λ‘œμ νŠΈλ₯Ό 주도

인기 κΈ€

졜근 κΈ€

졜근 λŒ“κΈ€

ν‹°μŠ€ν† λ¦¬

hELLO Β· Designed By μ •μƒμš°.
DrawingProcess

λ“œν”„ DrawingProcess

[C++] STL μ»¨ν…Œμ΄λ„ˆ: 자료ꡬ쑰λ₯Ό μ΄ν•΄ν•˜κ³  μ‚¬μš©ν•˜μž! (C++ ν‘œμ€€ 라이브러리)
Study: Software(SW)/SW: Language

[C++] STL μ»¨ν…Œμ΄λ„ˆ: 자료ꡬ쑰λ₯Ό μ΄ν•΄ν•˜κ³  μ‚¬μš©ν•˜μž! (C++ ν‘œμ€€ 라이브러리)

2022. 6. 13. 23:25
λ°˜μ‘ν˜•
πŸ’‘ λ³Έ λ¬Έμ„œλŠ” 'std μ»¨ν…Œμ΄λ„ˆ: μžλ£Œκ΅¬μ‘°λ₯Ό μ΄ν•΄ν•˜κ³  μ‚¬μš©ν•˜μž!'에 λŒ€ν•΄ 정리해놓은 κΈ€μž…λ‹ˆλ‹€.
C++ ν‘œμ€€ λΌμ΄λΈŒλŸ¬λ¦¬μ— κ΅¬ν˜„λ˜μ–΄ μžˆλŠ” μ»¨ν…Œμ΄λ„ˆμ— λŒ€ν•΄ μ •λ¦¬ν•˜μ˜€μœΌλ‹ˆ μ°Έκ³ ν•˜μ‹œκΈ° λ°”λžλ‹ˆλ‹€.

1. μ»¨ν…Œμ΄λ„ˆ (Container)

Sequence Containers

sequential containers are responsible to store data in sequence. It consists of arrays, vector, deque, forward list and list.

Associative Containers

Associative containers store associated/related data as key-value pairs. It consists of set, map, multi set and multimaps.

Unordered Associative Containers

Unordered elements use a hash function to map keys with their values. These unordered containers include the unordered set, unordered multiset, unordered map and unordered multimap.

2. C++ STL μ»¨ν…Œμ΄λ„ˆ (Container)

array

κ³ μ • 길이λ₯Ό κ°€μ§€λŠ” λ°°μ—΄. ν¬κΈ°λŠ” 컴파일 μ‹œμ— κ³ μ •λ˜λ©°, λ³€κ²½ν•  수 μ—†μŠ΅λ‹ˆλ‹€. index에 μ ‘κ·Όν•΄μ•Όλ§Œ ν•˜λŠ” μ΄μœ κ°€ μ—†λŠ” 이상 range-based for(e.g. auto const& num : nums)λ₯Ό μ‚¬μš©ν•˜λ„λ‘ ν•©λ‹ˆλ‹€.

#include "spdlog/fmt/fmt.h"
int main() {
    std::array<int, 3> nums{ 1, 2, 3};
    for(auto const& num : nums) { fmt::print("{}\n", num); }
    return 0;
}

vector

stackκ³Ό 같이 크기λ₯Ό μ‘°μ ˆν•  수 μžˆλŠ” μ»¨ν…Œμ΄λ„ˆ

#include "spdlog/fmt/fmt.h"
int main()
{
    std::vector<int> nums{ 1, 2, 3};
    names.push_back(4);
    for(auto const& num : nums) { fmt::print("{}\n", num); }
    return 0;
}

set (unordered_set)

집합을 닀루기 μœ„ν•΄ μ‚¬μš©ν•˜λŠ” μ»¨ν…Œμ΄λ„ˆ.

#include "spdlog/fmt/fmt.h"
#include <set>
int main()
{
    std::set<int> primes{2, 3, 5, 7, 5};
    for (auto const &prime : primes)
    {
        fmt::print("{}\n", prime);
    }
    return 0;
}

map (unordered_map)

ν”νžˆ λ§ν•˜λŠ” λ”•μ…”λ„ˆλ¦¬μ™€ 같은 κ°œλ…μœΌλ‘œ ν‚€-κ°’ μŒμ„ μ €μž₯ν•˜κΈ° μœ„ν•΄ μ‚¬μš©λ˜λ©°, ν‚€λ₯Ό 톡해 값을 찾을 수 μžˆμŠ΅λ‹ˆλ‹€.

#include "spdlog/fmt/fmt.h"
#include <unordered_map>
int main()
{
    std::unordered_map<int, std::string> primes{
        {2, "2"},
        {3, "3"},
        {5, "5"},
        {7, "7"}};
    for (auto const &prime : primes)
    {
        fmt::print("[{}]{}\n", prime.first, prime.second);
    }
    return 0;
}

3. μ‚¬μš©ν•  μ»¨ν…Œμ΄λ„ˆ κ³ λ₯΄λŠ” 방법

  • 집합이 ν•„μš”ν•œ 경우 set ν˜Ήμ€ unordered_set을 μ‚¬μš©ν•©λ‹ˆλ‹€.
  • ν‚€-κ°’ μ»¨ν…Œμ΄λ„ˆκ°€ ν•„μš”ν•œ 경우 mapν˜Ήμ€ unordered_map을 μ‚¬μš©ν•©λ‹ˆλ‹€.
  • κ·Έ μ™Έμ˜ κ²½μš°λŠ” λ‹€μŒ λ„ν‘œλ₯Ό μ°Έμ‘°ν•˜μ„Έμš”.

μ°Έκ³ 

  • [hacking C++] Std.Library: https://hackingcpp.com/cpp/std/associative_containers.html

 

λ°˜μ‘ν˜•
μ €μž‘μžν‘œμ‹œ λΉ„μ˜λ¦¬ λ³€κ²½κΈˆμ§€ (μƒˆμ°½μ—΄λ¦Ό)

'Study: Software(SW) > SW: Language' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€

[C++] ν…œν”Œλ¦Ώ (Template) (feat. Template Meta-programming)  (0) 2022.06.14
[C++] 객체지ν–₯ ν”„λ‘œκ·Έλž˜λ°: 좔상화, μΊ‘μŠν™”, 상속성, λ‹€ν˜•μ„±, 동적바인딩...  (0) 2022.06.13
[C++] 포인터(*), 레퍼런슀(&)와 μƒμˆ˜(Const) + Smart Pointer, Constexpr  (0) 2022.06.13
[C++] μžλ£Œν˜• 데이터 νƒ€μž…(Data Type): κ³ μ • 길이 μ •μˆ˜, ν˜•λ³€ν™˜(Type Casting)  (0) 2022.06.13
[Python] 직접 파이썬 μ‚¬μš©ν•˜κΈ° (feat. On-line interpreter)  (0) 2022.02.20
    'Study: Software(SW)/SW: Language' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€
    • [C++] ν…œν”Œλ¦Ώ (Template) (feat. Template Meta-programming)
    • [C++] 객체지ν–₯ ν”„λ‘œκ·Έλž˜λ°: 좔상화, μΊ‘μŠν™”, 상속성, λ‹€ν˜•μ„±, 동적바인딩...
    • [C++] 포인터(*), 레퍼런슀(&)와 μƒμˆ˜(Const) + Smart Pointer, Constexpr
    • [C++] μžλ£Œν˜• 데이터 νƒ€μž…(Data Type): κ³ μ • 길이 μ •μˆ˜, ν˜•λ³€ν™˜(Type Casting)
    DrawingProcess
    DrawingProcess
    과정을 그리자!

    ν‹°μŠ€ν† λ¦¬νˆ΄λ°”