|
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
1 | 5 | <p align="center"> |
2 | | - <img width="160" height="160" src="assets/OpenCSTL.png"> |
| 6 | + <img width="1024" src="assets/blogo.png"> |
3 | 7 | </p> |
4 | 8 |
|
5 | | -<h1 align="center">OpenCSTL</h1> |
6 | | -<p align="center">Open Source C Container Library like STL in C++</p> |
7 | | -<p align="center">C99 · C11 · C17 · C23</p> |
8 | | - |
9 | 9 |
|
10 | 10 |
|
11 | 11 |
|
|
53 | 53 | * `Linux`: `gcc`, `clang`, `tcc`를 지원합니다. |
54 | 54 | * `MacOS`: `gcc`, `clang`, `tcc`를 지원합니다. |
55 | 55 | * 직관적이고 깔끔한 인터페이스. |
56 | | - * |
| 56 | + * `SET`, `MAP`,`UNORDERED_SET`,`UNORDERED_MAP`,`PRIORITY_QUEUE` 사용시 오버로딩으로 비교 함수를 지정하지 않아도 기본 비교함수인 `memcpy`로 동작합니다. |
| 57 | + * 완전히 새로운 방식의 구현체로 타 라이브러리에 비해 압도적으로 쉽고 깔끔한 인테피이스를 보장합니다. |
57 | 58 |
|
58 | 59 | * * * |
59 | 60 |
|
|
79 | 80 |
|
80 | 81 |
|
81 | 82 |
|
82 | | - |
| 83 | +## Components |
| 84 | + |
| 85 | +```markdown |
| 86 | +## Containers |
| 87 | +- `VECTOR(T)` — dynamic array |
| 88 | +- `LIST(T)` — doubly linked list |
| 89 | +- `DEQUE(T)` — double-ended queue |
| 90 | +- `SET(T)` — sorted set (red-black tree) |
| 91 | +- `MAP(K)` — sorted map (red-black tree) |
| 92 | +- `UNORDERED_SET(T)` — hash set |
| 93 | +- `STACK(T)` — stack |
| 94 | +- `QUEUE(T)` — queue |
| 95 | +- `QUEUE(T)` / `new_priority_queue` — priority queue (min/max heap) |
| 96 | + |
| 97 | +## Algorithms |
| 98 | +- `sort` — unstable sort |
| 99 | +- `stable_sort` — stable sort |
| 100 | +- `find` — linear search |
| 101 | +- `LESS(T)` / `GREATER(T)` — built-in comparators |
| 102 | + |
| 103 | +## Iterator |
| 104 | +- `begin` / `end` — range iterator |
| 105 | +- `rbegin` / `rend` — reverse iterator |
| 106 | +- `next` / `prev` — iterator traversal |
| 107 | +- `cstl_begin` / `cstl_find` — list iterator helpers |
| 108 | + |
| 109 | +## Container Operations |
| 110 | +- `push_back` / `pop_back` — back insert/remove |
| 111 | +- `push_front` / `pop_front` — front insert/remove |
| 112 | +- `push` / `pop` / `top` — stack/queue/priority_queue ops |
| 113 | +- `insert` — single or range insert (overloaded) |
| 114 | +- `erase` — single or range erase |
| 115 | +- `assign` — fill assign (overloaded) |
| 116 | +- `resize` — resize with optional fill value (overloaded) |
| 117 | +- `size` / `capacity` — size queries |
| 118 | +- `empty` — empty check |
| 119 | +- `front` / `back` — element access |
| 120 | +- `first` / `second` — map key/value access |
| 121 | +- `destroy` — memory free |
| 122 | + |
| 123 | +## Map Operations |
| 124 | +- `first(it)` — key access |
| 125 | +- `second(it, T)` — value access |
| 126 | + |
| 127 | +## Utilities |
| 128 | +- `rand32` — random number generator |
| 129 | +- `watch` / `now` / `duration` — timer |
| 130 | +- `logging.debug` / `.info` / `.warning` / `.error` / `.critical` / `.fatal` / `.message` — |
| 131 | +## logging |
| 132 | +- `opencstl_version` — version string |
| 133 | +- `opencstl_env` — environment info |
| 134 | +- `cstl_error` — error reporting |
| 135 | +``` |
83 | 136 |
|
84 | 137 |
|
85 | 138 | ## Why OpenCSTL? |
|
0 commit comments