Namespaces
Variants

std::match_results<BidirIt,Alloc>:: match_results

From cppreference.net
Regular expressions library
Classes
(C++11)
Algorithms
Iterators
Exceptions
Traits
Constants
(C++11)
Regex Grammar
match_results ( ) : match_results ( Allocator ( ) ) { }
(1)
explicit match_results ( const Allocator & a ) ;
(2)
match_results ( const match_results & rhs ) ;
(3)
match_results ( const match_results & rhs, const Allocator & a ) ;
(4)
match_results ( match_results && rhs ) noexcept ;
(5)
match_results ( match_results && rhs, const Allocator & a ) ;
(6)
**참고**: C++ 코드 내의 모든 텍스트(match_results, Allocator, explicit, const, noexcept 등)와 HTML 태그/속성은 번역하지 않고 원본 그대로 유지되었습니다. 번호 (1)-(6)도 원본 형식 그대로 보존되었습니다.
1,2) 결과 상태가 설정되지 않은 매치 결과를 생성합니다.
1) 기본 생성자.
2) 할당자로 a 의 복사본을 사용하여 매치 결과를 생성합니다.
생성이 완료되면, ready() false 를 반환하고 size() 0 을 반환합니다.
3-6) rhs 로부터 매치 결과를 생성합니다.
3) 복사 생성자.
4) 할당자로 a 의 복사본을 사용하여 매치 결과를 생성합니다.
5) 이동 생성자. 생성이 완료되면, rhs 는 유효하지만 지정되지 않은 상태가 됩니다.
6) a 를 할당자로 사용하여 매치 결과를 구성합니다. 생성이 완료되면 rhs 는 유효하지만 지정되지 않은 상태가 됩니다.
생성 이전 rhs 의 값을 m 으로, [ 0 , m. size ( ) ) 범위 내의 임의의 정수를 n 으로 가정할 때, 생성이 완료된 후 다음 멤버 함수들은 지정된 값을 반환해야 합니다:
멤버 함수 반환 값
ready() m. ready ( )
size() m. size ( )
str(n) m. str ( n )
prefix() m. prefix ( )
suffix() m. suffix ( )
operator[](n) m [ n ]
length(n) m. length ( n )
position(n) m. position ( n )

목차

매개변수

a - 이 컨테이너의 모든 메모리 할당에 사용할 할당자
rhs - match_results 를 초기화하는 데 소스로 사용할 다른 match_results

예외

1-4) 구현에서 정의된 예외를 발생시킬 수 있습니다.
6) a == rhs. get_allocator ( ) true 인 경우 아무것도 throw하지 않습니다.

예제

결함 보고서

다음 동작 변경 결함 보고서는 이전에 발표된 C++ 표준에 소급 적용되었습니다.

DR 적용 대상 게시된 동작 올바른 동작
LWG 2191 C++11 n 가 오버로드 (3-6) 의 사후 조건에서 음수일 수 있었음 음수가 아닌 값만 가능
LWG 2195 C++11 AllocatorAwareContainer 에서 요구하는 생성자가 누락됨 추가됨
P0935R0 C++11 기본 생성자가 explicit였음 implicit로 변경됨