Programming
-
[c++] priority_queueProgramming/c++ 2023. 2. 12. 14:11
c++에서 priority_queue는 max heap 개념입니다. 가장 큰 요소가 항상 맨 위 위치에 있도록 해당 요소를 정렬합니다. 항상 가장 크거나 우선 순위가 가장 높은 일부 기본 컨테이너 형식의 최상위 요소에 대한 액세스를 제한하는 기능 제한을 제공하는 템플릿 컨테이너 어댑터 클래스입니다. 새 요소를 추가할 priority_queue 수 있으며 해당 요소의 priority_queue 최상위 요소를 검사하거나 제거할 수 있습니다. 1. 클래스 헤더 파일 #include 2.클래스 원형 template class priority_queue priority_queue pq; // T : 구조체 3. Parameter (매개 변수) Type priority_queue에 저장되는 요소 데이터 형식 Con..
-
[c++] basic_regex classProgramming/c++ 2023. 1. 20. 14:58
1. Parameter Elem The type of element to find a match for. RXtraits Traits class for elements. 2. Described 클래스 템플릿은 정규식을 보유하는 개체를 설명합니다. 이 클래스 템플릿의 개체는 템플릿 함수 regex_match, regex_search 및 regex_replace 전달할 수 있습니다. 또한 정규식과 일치하는 텍스트를 검색하기 위해 적절한 텍스트 문자열 인수를 전달합니다. 이 클래식 템플릿에는 char 타입 원소인 regex와 wchar_t 타입 원소인 wregex를 사용하는 두 개의 전문 클래스 템플릿이 있습니다. 3. Member member default public static const flag_typ..
-
[c++] regex swap 함수Programming/c++ 2023. 1. 20. 14:07
1.함수 헤더 파일 #include 2.함수 원형 template void swap( basic_regex& left, basic_regex& right) noexcept; template void swap( match_results& left, match_results& right) noexcept; 3. Parameter Elem The type of element to find a match for. RXtraits The attribute class for the element. 4. Described 템플릿 함수는 일정한 시간 내에 인수의 내용을 교환하고 예외를 발생시키지 않습니다. 4.예제 #include #include int main() { regex rx0("c(a*)|(b)"); reg..
-
[c++] regex_replace 함수Programming/c++ 2023. 1. 20. 13:24
1.함수 헤더 파일 #include 2.함수 원형 template OutIt regex_replace( OutIt out, BidIt first, BidIt last, const basic_regex& re, const basic_string& fmt, match_flag_type flags = match_default); template basic_string regex_replace( const basic_string& str, const basic_regex& re, const basic_string& fmt, match_flag_type flags = match_default); 3. Parameter(매개 변수) OutIt The iterator type for replacement. BidIt..
-
[c++] regex_match 함수Programming/c++ 2023. 1. 20. 12:55
1.함수 헤더 파일 #include 2.함수 원형 regex_match : 정규식이 전체 대상 문자열과 일치하는지 여부를 테스트합니다. // (1) template bool regex_match( BidIt first, Bidit last, match_results& match, const basic_regex& re, match_flag_type flags = match_default); // (2) template bool regex_match( BidIt first, Bidit last, const basic_regex& re, match_flag_type flags = match_default); // (3) template bool regex_match( const Elem *ptr, match..
-
[c++] regex 라이브러리Programming/c++ 2023. 1. 20. 11:43
Regex 라이브러리 #include regex는 regular expression(정규 표현식)으로, 문자열에서 패턴을 찾는데 사용합니다. 특정한 규칙을 가진 문자열의 집합을 표현하는 데 사용하는 형식 언어입니다. 정규 표현식은 많은 텍스트 편집기와 프로그래밍 언어에서 문자열의 검색과 치환을 위해 지원하고 있습니다. 정규 표현식에 관한 자세한 설명은 아래 포스팅을 참고해주세요:) [CS] 정규 표현식 Regular Expression, Regex Regular Expression 정규식은 특정한 규칙을 가진 문자열의 집합을 표현하는 데 사용하는 형식 언어입니다. 정규 표현식은 많은 텍스트 편집기와 프로그래밍 언어에서 문자열의 검색과 치환을 위해 code-space.tistory.com Class 정규식..
-
[c++] std::partition_pointProgramming/c++ 2022. 12. 26. 14:04
1.함수 헤더 파일 #include 2.함수 원형 template ForwardIterator partition_point( ForwardIterator first, ForwardIterator last, UnaryPredicate pred); 조건을 충족하지 않는 지정된 범위의 첫 번째 요소를 반환합니다. 조건을 충족하는 요소가 그렇지 않은 요소 앞에 오도록 요소가 정렬됩니다. 3.return 값(반환 값) 반복자를 반환합니다. 테스트한 조건을 충족하지 않는 첫 번째 요소의 반복자, 반환하는 pred에서 last 반복자까지 찾을 수 없는 경우 4.예제 std::vector vec2 {2, 4, 6, 8, 10, 1, 3, 5, 7, 9}; auto point = std::partition_point(v..