std::indirectly_writable(3cxx)

πŸ“¦
version 16-20260322 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ NAME ✨

std::indirectly_writable β€” the vibe check for whether you can actually write a value into the thing an iterator points at πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <iterator>

πŸ’… Concept definition

template<typename _Out, typename _Tp>
concept std::indirectly_writable =  requires(_Out&& __o, _Tp&& __t)
      {
        *__o = std::forward<_Tp>(__t);
        *std::forward<_Out>(__o) = std::forward<_Tp>(__t);
        const_cast<const iter_reference_t<_Out>&&>(*__o)
          = std::forward<_Tp>(__t);
        const_cast<const iter_reference_t<_Out>&&>(*std::forward<_Out>(__o))
          = std::forward<_Tp>(__t);
      }

πŸŽ€ DESCRIPTION πŸŽ€

okay so bestie, here's the whole entire point of this concept: it's the requirements for writing a value into an iterator's referenced object. That's it. That's the assignment. πŸ’«

Like, if you're sitting there with an _Out and a _Tp and you're wondering "can I just slam this value into whatever that iterator is pointing at?" β€” this is the concept that answers that for you. No cap. 🫢

🌸 Detailed Description 🌸

Requirements for writing a value into an iterator's referenced object. πŸ¦‹

ngl it's giving very "short and sweet" energy, but that's because the concept definition up there does ALL the heavy lifting. Every single one of those requires expressions has to hold for the concept to be satisfied β€” all four of them, no skipping. πŸ”₯

πŸ‘‘ AUTHOR πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. πŸ€–βœ¨


and that's the whole page, bestie β€” no notes, iconic, periodt πŸ’…πŸŒΈ

mwah πŸ’‹ β€” this lil rewrite lives in the libstdc++ manual, brought to you by the fine folks at std::indirectly_writable(3cxx). go write into some iterators responsibly, k? πŸŽ€

πŸ“¦ where this page comes from