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
- 그라나다
- 마드리드
- 스프링 AOP
- kotiln
- 스페인
- 아펠가모 선릉
- http상태코드
- 400에러
- 본식후기
- HTTP #웹기술
- git명령어
- 아펠가모선릉
- Srping AOP
- 아펠가모
- 스페인 준비물
- @Component
- HTTP
- 바르셀로나
- b-tree index
- Kotlin
- 세비야
- 코틀린
- kopring
- db index
- sprintboot
- c# scv
- 코프링
- 관심지향프로그래밍
- 코틀린 함수
- elk
Archives
- Today
- Total
끄적이는 메모장
[C++11] std::all_of, / std::any_of / std::none_of 본문
반응형
# std::all_of
주어진 범위의 값들이 주어진 조건을 모두 만족하는 경우 -> true 아니면 false를 반환
혹은 주어진 범위가 empty라면 true
# std::any_of
주어진 범위 값들 중 하나라도 조건을 만족하는 경우 -> true, 모두 만족하지 못하는 경우 false를 반환
혹은 주어진 범위가 empty라면 false
# std::none_of
주어진 범위의 값들이 모두 주어진 조건을 만족하지 못하는 경우 -> true 아니면 false를 반환
혹은 주어진 범위가 empty라면 true
int main() {
std::vector<int> v {4,7,10};
std::all_of(v.begin(), v.end(), [](int i){return i%3}) -> true
std::all_of(v.begin(), v.end(), [](int i){return i%2}) -> false
std::any_of(v.begin(), v.end(), [](int i){return i%2}) -> true
std::any_of(v.begin(), v.end(), [](int i){return i/11}) -> false
std::none_of(v.begin(), v.end(), [](int i){return i/11}) -> true
std::none_of(v.begin(), v.end(), [](int i){return i%3}) -> false
}
반응형
'C, C++, C# > C++ 공부' 카테고리의 다른 글
[C++] std::set_intersection (0) | 2018.06.08 |
---|---|
[C++11] tuple (0) | 2018.06.07 |
[C++11] std::make_pair / std::move / std::swap (0) | 2018.06.07 |
[C++11] std::enable_shared_from_this (0) | 2018.06.07 |
[C++11] mutex (0) | 2018.06.01 |