std::type_index:: name
From cppreference.net
<
cpp
|
types
|
type index
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Type support
| Basic types | |||||||||||||||||||||
| Fixed width integer types (C++11) | |||||||||||||||||||||
| Fixed width floating-point types (C++23) | |||||||||||||||||||||
|
|||||||||||||||||||||
| Numeric limits | |||||||||||||||||||||
| C numeric limits interface | |||||||||||||||||||||
| Runtime type information | |||||||||||||||||||||
|
|||||||||||||||||||||
std::type_index
| Member functions | ||||
|
type_index::name
|
||||
| Helper classes | ||||
|
(C++11)
|
|
const
char
*
name
(
)
const
noexcept
;
|
(C++11 이후) | |
관련된 std::type_info 객체의 이름을 반환합니다. std::type_info::name() 을 직접 호출하는 것과 동일합니다.
목차 |
매개변수
(없음)
반환값
연관된 std::type_info 객체의 이름입니다.
예제
이 코드 실행
#include <iostream> #include <typeindex> int main() { std::cout << std::type_index(typeid(std::cout)).name(); }
가능한 출력:
NSt3__113basic_ostreamIcNS_11char_traitsIcEEEE
결함 보고서
다음의 동작 변경 결함 보고서들은 이전에 발표된 C++ 표준에 소급 적용되었습니다.
| DR | 적용 대상 | 게시된 동작 | 올바른 동작 |
|---|---|---|---|
| LWG 2144 | C++11 |
type_index::name
에 noexcept 요구사항이 없었음
|
요구됨 |