Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- AES
- CustomTab
- SHA512
- sha256
- go
- c++
- template
- SHA1
- sprintf
- web
- Scala
- type_traits
- coroutines
- kotlin
- Clojure
- Observer
- traits
- stringprintf
- design pattern
- RAII
- ranges
- async
- Chrono
- haskell
- Functional
- WebView
- ChromeTab
- program
- Reflect
- Android
Archives
- Today
- Total
프로그래밍 검색 블로그
C++ ranges view::join (flatMap) 본문
두 ranges를 연결할것 같은 이름이지만 실제로는 다른 언어의 flatMap과 동일
이차원 컨테이너의 원소들을 1차원으로 만든다
1 2 3 4 5 6 7 8 9 | vector<vector<int>> nums = { {1,2,3,4,5}, {6,7,8,9,10}, {1,2,3,4,5}, {6,7,8,9,10}, }; vector<int> flat_nums = view::join(nums); cout << view::all(flat_nums) << endl; | cs |
출력: [1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10]
'C++ ranges' 카테고리의 다른 글
| C++ ranges view::group_by (0) | 2017.10.08 |
|---|---|
| C++ ranges view::c_str (0) | 2017.10.08 |
| C++ ranges view::tail (0) | 2017.10.08 |
| C++ ranges view::cycle (0) | 2017.10.08 |
| C++ ranges view::take (0) | 2017.10.08 |
Comments