std::experi...::projected(3)
๐ธ NAME ๐ธ
std::experimental::ranges::projected โ bestie, this is literally the page for std::experimental::ranges::projected ๐
okay so first things first: this page lives in the C++ Standard Libary manual โ yep, โLibary,โ thatโs the spelling on the tin ๐ซถ โ and its header title is std::experi...::projected(3). No cap, thatโs the whole vibe check.
โจ Synopsis โจ
Defined in header <experimental/ranges/iterator>:
template< Readable I, IndirectRegularUnaryInvocable<I> Proj >
struct projected {
using value_type =
std::remove_cv_t<std::remove_reference_t<ranges::indirect_result_of_t<Proj&(I)>>>;
ranges::indirect_result_of_t<Proj&(I)> operator*() const;
};
(TS)
template< WeaklyIncrementable I, class Proj >
struct difference_type<projected<I, Proj>> {
using type = ranges::difference_type_t<I>;
};
The class template projected bundles a Readable type I and a function Proj into a brand-new Readable type โ and bestie, that new typeโs reference type is literally the result of applying Proj to the reference type of I โจ.
It exists solely to ease constraint specification, so thatโs its whole main-character job ๐. Because of that, its operator*() may not actually be defined โ like, it might just be there for the constraints, not for actual dereferencing ๐. Not me warning you about a possibly-undefined operator*() โ itโs giving โlook with your eyes, not your handsโ ๐.
Real talk: operator*() may not actually be defined. Thatโs not a bug in the rewrite, thatโs the original tea โ.
okay bye bestie ๐ this little gem came from http://cppreference.com, with source/version date 2024.06.10, and itโs page std::experi...::projected(3) โ mwah ๐
๐ฆ 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