std::type_index::name(3)
π¦ std::type_index::name(3) Β· C++ Standard Libary π¦
okay bestie, welcome to the std::type_index::name(3) page from the C++ Standard Libary manual β yes, thatβs the manual name, spelling and all, and sheβs iconic. π
β¨ NAME β¨
std::type_index::name β std::type_index::name. Thatβs it, thatβs the name, no cap. Itβs giving βsame thing on both sidesβ but make it make sense: this is the page for the name() part of std::type_index. π«Ά
π Synopsis π
const char* name() const noexcept; (since C++11)
Returns the name of the associated std::type_info object. Equivalent to calling std::type_info::name() directly β same energy, no extra steps. β¨
π«Ά Parameters π«Ά
(none)β literally no parameters, bestie. Not a single one. π
β Return value β
The name of the associated std::type_info object. Thatβs the whole return value. Slay. πΈ
π Example π
// Run this code
#include <iostream>
#include <typeindex>
int main() {
std::cout << std::type_index(typeid(std::cout)).name();
}
π Possible output: π
NSt3__113basic_ostreamIcNS_11char_traitsIcEEEE
π Defect reports π
The following behavior-changing defect reports were applied retroactively to previously published C++ standards β hereβs the tea: π΅
- DR: LWG 2144 β Applied to: C++11. Behavior as published:
type_index::namewas not required to benoexcept. Correct behavior: requirednoexcept.
source/version: http://cppreference.com Β· date: 2024.06.10 β signing off with the cutest little manual-page footer energy, bestie. Go call .name() and slay. ππ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms