std::projected_value_t(3)
π std::projected_value_t(3) π
okay bestie, welcome to the std::projected_value_t(3) page from the C++ Standard Libary β manual name folded in near the top, just like we said, and we are not copying the whole header line because we have main character energy today β¨
πΈ NAME πΈ
std::projected_value_t β and the one-liner is literally also std::projected_value_t. iconic self-reference, no notes π
π Synopsis π
Defined in header <iterator>:
template< std::indirectly_readable I,
std::indirectly_regular_unary_invocable<I> Proj >
using projected_value_t =
std::remove_cvref_t<std::invoke_result<Proj&,
std::iter_value_t<I>&>>;
(since C++26)
so here's the tea π«: the alias template projected_value_t obtains the value type by stripping any reference and its topmost cv-qualifiers from the result type of applying Proj to std::iter_value_t<I>&.
and yes, projected_value_t is used to determine the default value type in some algorithms such as ranges::contains. slay π
π§ Template parameters π§
Iβ an indirectly readable typeProjβ projection applied to an lvalue reference to value type ofI
β¨ Notes β¨
feature-test macro check, bestie π
- Feature-test macro:
__cpp_lib_default_template_type_for_algorithm_values - Value:
202403L - Std:
(C++26) - Feature: default template type for algorithm values using
std::projected_value_t
π Example π
This section is incomplete Reason: no example π
π¦ See also π¦
indirect_result_t(C++20) β computes the result of invoking a callable object on the result of dereferencing some set ofindirectly_readabletypes (alias template)projected(C++20) β helper template for specifying the constraints on algorithms that accept projections (class template)
π·οΈ Category π·οΈ
- Todo no example π
mwah π β source and version/date sign-off: http://cppreference.com, 2024.06.10, page std::projected_value_t(3). periodt π
π¦ 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