Namespaces
Variants

std::experimental:: bad_any_cast

From cppreference.net
헤더에 정의됨 <experimental/any>
class bad_any_cast : public std:: bad_cast ;
(라이브러리 fundamentals TS)

실패 시 값-반환 형태의 std::experimental::any_cast 에 의해 던져질 객체의 유형을 정의합니다.

목차

멤버 함수

(생성자)
새로운 bad_any_cast 객체를 생성함
(public 멤버 함수)
operator=
bad_any_cast 객체를 대체함
(public 멤버 함수)
what
설명 문자열을 반환함
(public 멤버 함수)

std::experimental::bad_any_cast:: bad_any_cast

bad_any_cast ( ) noexcept ;
(1) (라이브러리 fundamentals TS)
bad_any_cast ( const bad_any_cast & other ) noexcept ;
(2) (라이브러리 fundamentals TS)

bad_any_cast 객체를 생성합니다. 구현에서 정의된 null-terminated 바이트 문자열을 포함하며, 이는 what() 을 통해 접근할 수 있습니다.

1) 기본 생성자입니다.
2) 복사 생성자입니다. * this other 모두 std::experimental::bad_any_cast 동적 타입을 가진다면 std:: strcmp ( what ( ) , other. what ( ) ) == 0 입니다.

매개변수

other - 복사할 다른 예외 객체

std::experimental::bad_any_cast:: operator=

bad_any_cast & operator = ( const bad_any_cast & other ) noexcept ;
(라이브러리 fundamentals TS)

내용을 other 의 내용으로 대입합니다. * this other 모두 동적 타입이 std::experimental::bad_any_cast 인 경우, 대입 후 std:: strcmp ( what ( ) , other. what ( ) ) == 0 입니다.

매개변수

other - 대입할 다른 예외 객체

반환값

* this

std::experimental::bad_any_cast:: what

virtual const char * what ( ) const noexcept ;
(library fundamentals TS)

설명 문자열을 반환합니다.

반환 값

설명 정보를 담은 구현 정의 널 종료 문자열에 대한 포인터입니다. 이 문자열은 std::wstring 으로 변환 및 표시하기에 적합합니다. 이 포인터는 적어도 해당 예외 객체가 파괴되거나 예외 객체의 비상수 멤버 함수(예: 복사 할당 연산자)가 호출되기 전까지는 유효함이 보장됩니다.

참고

구현체는 what() 을 재정의할 수 있지만 필수는 아닙니다.

std:: bad_cast 에서 상속됨

std::exception으로부터 std:: exception 상속됨

멤버 함수

[virtual]
예외 객체를 파괴함
( std::exception 의 virtual public 멤버 함수)
[virtual]
설명 문자열을 반환함
( std::exception 의 virtual public 멤버 함수)