std::nontyp...d::nontype_t(3)
β¨ std::nontype, std::nontype_t β¨
okay so this is the C++ Standard Libary manual page, section 3, for std::nontype and std::nontype_t β typo in the header and all, sheβs still iconic π
. This whole thing is a C++26 moment, bestie, so hydrate and get comfy π«Ά.
π NAME π
std::nontype,std::nontype_t β std::nontype,std::nontype_t. Thatβs it. Thatβs the name section. She said what she said π.
π Synopsis π
Defined in header <utility>. The code is giving template realness, so here it is exactly:
template< auto V > (1) (since C++26)
struct nontype_t { explicit nontype_t() = default; };
template< auto V > (2) (since C++26)
inline constexpr std::nontype_t<V> nontype {};
- The class template
std::nontype_tcan be used in the constructor's parameter list to match the intended tag. Yes, thatβs the whole job β tag matching, no cap β¨. - The corresponding
std::nontypeinstance of (1) is a disambiguation argument tag that can be passed to the constructors ofstd::function_refto indicate that the contained object should be constructed with the value of the non-type template parameterV. Itβs giving βhello, construct me like thisβ energy π«Ά.
π§© Template parameters π§©
Vβ non-type template parameter of a structural type. Structural type, bestie, thatβs the vibe check π.
π See also π
function_refβ non-owning reference to any callable object with specified function call signature (C++26) (class template). Obsessed, honestly.
mwah π source/version is http://cppreference.com, dated 2024.06.10. Thatβs the whole page β go slay some C++26, bestie πβ¨
π¦ 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