Files
2025-10-25 03:02:53 +03:00

21 lines
993 B
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[meta.help]
# 21 Metaprogramming library [[meta]](./#meta)
## 21.3 Metaprogramming and type traits [[type.traits]](type.traits#meta.help)
### 21.3.4 Helper classes [meta.help]
[🔗](#lib:value_type,integral_constant)
namespace std {template<class T, T v> struct [integral_constant](#lib:integral_constant "21.3.4Helper classes[meta.help]") {static constexpr T value = v; using value_type = T; using type = integral_constant<T, v>; constexpr operator value_type() const noexcept { return value; }constexpr value_type operator()() const noexcept { return value; }};}
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L643)
The class template integral_constant,
alias template bool_constant, and
its associated [*typedef-name*](dcl.typedef#nt:typedef-name "9.2.4The typedef specifier[dcl.typedef]")*s*true_type and false_type are used as base classes to define
the interface for various type traits[.](#1.sentence-1)