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 |
Tags
- WebView
- Observer
- template
- kotlin
- async
- coroutines
- haskell
- SHA1
- ranges
- Android
- program
- Reflect
- go
- design pattern
- SHA512
- Clojure
- Chrono
- traits
- stringprintf
- AES
- Scala
- Functional
- CustomTab
- web
- sprintf
- type_traits
- RAII
- sha256
- ChromeTab
- c++
Archives
- Today
- Total
프로그래밍 검색 블로그
C++ ranges view::take 본문
take는 C#의 Take() 와 비슷하게 생성하는 원소들을 제한한다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #include <iostream> #include <map> #include <vector> #include <range/v3/view.hpp> using namespace std; using namespace ranges; int main(){ vector<int> c = view::iota(0) // <- 인자가 한개일떄는 수열 무한대 | view::take(5); cout << view::all(c) << endl; } | cs |
take를 사용해서 무한대 수열을 다룰수 있다
'C++ ranges' 카테고리의 다른 글
C++ ranges view::tail (0) | 2017.10.08 |
---|---|
C++ ranges view::cycle (0) | 2017.10.08 |
C++ ranges yield_if (0) | 2017.10.08 |
C++ ranges view::for_each (0) | 2017.10.08 |
C++ ranges view::filter (0) | 2017.10.07 |
Comments