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
- sprintf
- Observer
- coroutines
- traits
- Functional
- ChromeTab
- Chrono
- type_traits
- template
- CustomTab
- ranges
- haskell
- AES
- Clojure
- web
- WebView
- program
- Reflect
- async
- design pattern
- c++
- RAII
- Android
- SHA1
- sha256
- kotlin
- go
- stringprintf
- SHA512
- Scala
Archives
- Today
- Total
프로그래밍 검색 블로그
C++ ranges action::take 본문
1 2 3 4 5 6 | vector<int> v = view::ints(0,10); //algorithm/copy.hpp vector<int> cp = v | ranges::copy | action::take(3); cout << view::all(cp) << endl; | cs |
혹은
1 2 3 4 5 6 | vector<int> v = view::ints(0,10); //algorithm/copy.hpp v |= action::take(3); cout << view::all(v) << endl; | cs |
출력:[0,1,2]
view::take 와는 달리 이쪽은 원본을 바꾼다.
'C++ ranges' 카테고리의 다른 글
| C++ ranges action::unique (0) | 2017.10.15 |
|---|---|
| C++ ranges action::sort (0) | 2017.10.15 |
| C++ ranges action::shuffle (0) | 2017.10.09 |
| C++ ranges view::unique (0) | 2017.10.09 |
| C++ ranges view::generate (0) | 2017.10.09 |
Comments