std::indirectly_copyable(3)
std::indirectly_copyable(3) π
β¨
okay bestie, welcome to the C++ Standard Libary page for std::indirectly_copyable β and yes, the header says βLibary,β not βLibrary,β so weβre keeping her exactly as she is π«Ά. This is a C++20 concept, itβs giving iterator-relationship realness, and weβre gonna read it together like a group chat. No cap.
πΈ NAME πΈ
std::indirectly_copyable β literally std::indirectly_copyable. Thatβs the name, thatβs the whole thing, periodt π.
β¨ Synopsis β¨
Defined in header <iterator>
template< class In, class Out >
concept indirectly_copyable = (since
C++20)
std::indirectly_readable<In> &&
std::indirectly_writable<Out, std::iter_reference_t<In>>;
The page literally says (since C++20), so you know itβs fresh β¨. And yes, that line break is canon, bestie π.
So whatβs the concept actually saying? std::indirectly_copyable specifies the relationship between an indirectly_readable type and a type that is indirectly_writable. The indirectly_writable type must be able to directly copy the object that the indirectly_readable type references. Thatβs the whole flex: readable on one side, writable on the other, and the copy can happen directly. Slay π
.
bestie PSA: the requirements are real β bothstd::indirectly_readable<In>andstd::indirectly_writable<Out, std::iter_reference_t<In>>have to hold. π₯
π See also π
indirectly_movable(C++20) β specifies that values may be moved from anindirectly_readabletype to anindirectly_writabletype (concept). π¦indirectly_copyable_storable(C++20) β specifies that values may be copied from anindirectly_readabletype to anindirectly_writabletype and that the copy may be performed via an intermediate object (concept). π
mwah π source is http://cppreference.com, dated 2024.06.10, and the page is std::indirectly_copyable(3). byeee bestie, go copy something directly πβ¨
π¦ 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