STD::EXPERIMENTAL::PROPAGATE_CONST(3)

πŸ’– NAME πŸ’–

std::experimental::propagate_const< _Tp > β€” a const-propagating wrapper, bestie. That's the whole thing, that's the vibe ✨

It's a Library Functions Manual page and it lives in libstdc++, so like, that's the fam we're hanging with 🫢


🌈 SYNOPSIS 🌈

#include <propagate_const>

πŸŽ€ Public Types πŸŽ€

  • using element_type β€” the one and only public type alias this class declares. That's the line. Short, sweet, iconic πŸ’…

πŸ¦‹ Public Member Functions πŸ¦‹

okay so here's the full roster, no skips, every single one πŸ‘‘

  • converting constructor, non-convertible flavour β€” only shows up when the constraints pass: _Tp has to be constructible from _Up &&, _Up && must not be convertible to _Tp, and the decayed _Up must not itself be a propagate_const. That trailing bool is false here.
template<typename _Up, typename enable_if< __and_< is_constructible< _Tp, _Up && >, __not_< is_convertible< _Up &&, _Tp > >, __not_< __is_propagate_const< typename decay< _Up >::type > > >::value, bool >::type = false> constexpr propagate_const (_Up &&__u)
  • converting constructor, convertible flavour β€” same deal but the other way: _Tp constructible from _Up &&, _Up && is convertible to _Tp, and the decayed _Up still isn't a propagate_const. Trailing bool defaults to true this time.
template<typename _Up, typename enable_if< __and_< is_constructible< _Tp, _Up && >, is_convertible< _Up &&, _Tp >, __not_< __is_propagate_const< typename decay< _Up >::type > > >::value, bool >::type = true> constexpr propagate_const (_Up &&__u)
  • copy constructor β€” =delete. Not happening. No copying, periodt 🚫
propagate_const (const propagate_const &__p)=delete
  • move constructor β€” =default, so it's the compiler's own, untouched πŸ’…
constexpr propagate_const (propagate_const &&__p)=default
  • converting move constructor, non-convertible flavour β€” pulls from a propagate_const< _Up > && when _Tp is constructible from _Up && and _Up && is not convertible to _Tp. Trailing bool is false.
template<typename _Up, typename enable_if< __and_< is_constructible< _Tp, _Up && >, __not_< is_convertible< _Up &&, _Tp > > >::value, bool >::type = false> constexpr propagate_const (propagate_const< _Up > &&__pu)
  • converting move constructor, convertible flavour β€” same but _Up && is convertible to _Tp. Trailing bool defaults to true.
template<typename _Up, typename enable_if< __and_< is_constructible< _Tp, _Up && >, is_convertible< _Up &&, _Tp > >::value, bool >::type = true> constexpr propagate_const (propagate_const< _Up > &&__pu)
  • get (non-const) β€” hands you back an element_type *.
constexpr element_type * get ()
  • get (const) β€” the const flavour, hands you back a const element_type *.
constexpr const element_type * get () const
  • operator bool β€” the truthiness check, const, constexpr ✨
constexpr operator bool () const
  • operator* β€” deref, non-const, gives you an element_type &.
constexpr element_type & operator* ()
  • operator* (const) β€” deref, const, gives you a const element_type &.
constexpr const element_type & operator* () const
  • operator-> β€” arrow, non-const, gives you an element_type *.
constexpr element_type * operator-> ()
  • operator-> (const) β€” arrow, const, gives you a const element_type *.
constexpr const element_type * operator-> () const
  • assignment from _Up && β€” only enabled when _Up && is convertible to _Tp and the decayed _Up is not a propagate_const. Returns propagate_const &.
template<typename _Up, typename = typename
    enable_if<__and_<is_convertible<_Up&&, _Tp>,
    __not_<__is_propagate_const<
    typename decay<_Up>::type>>
    >::value>::type> constexpr propagate_const & operator= (_Up &&__u)
  • copy assignment β€” =delete again. Still no copying, bestie πŸ’€
propagate_const & operator= (const propagate_const &__p)=delete
  • move assignment β€” =default, compiler's own πŸ‘‘
constexpr propagate_const & operator= (propagate_const &&__p)=default
  • move assignment from propagate_const< _Up > && β€” enabled when _Up && is convertible to _Tp. Returns propagate_const &.
template<typename _Up, typename = typename
    enable_if<is_convertible<_Up&&, _Tp>::value>::type> constexpr
    propagate_const & operator= (propagate_const< _Up > &&__pu)
  • swap β€” swaps with another propagate_const &. It's noexcept exactly when __is_nothrow_swappable< _Tp >::value is true, so the noexcept-ness rides entirely on _Tp πŸ¦‹
constexpr void swap (propagate_const &__pt)
    noexcept(__is_nothrow_swappable< _Tp >::value)

🌸 Friends 🌸

the little helper besties that get to peek inside 🫢

  • get_underlying (const) β€” takes a const propagate_const< _Up > & and gives you back a const _Up &. It's noexcept, no drama.
template<typename _Up> constexpr const _Up & get_underlying (const
    propagate_const< _Up > &__pt) noexcept
  • get_underlying (non-const) β€” takes a propagate_const< _Up > & and gives you back a _Up &. Also noexcept.
template<typename _Up> constexpr _Up & get_underlying (propagate_const<
    _Up > &__pt) noexcept

πŸ’œ Detailed Description πŸ’œ

here's the whole class, laid out in its full templated glory:

template<typename _Tp>
class std::experimental::propagate_const< _Tp >
"Const-propagating wrapper."

That's the description. It's short. It's giving minimalism. We respect it πŸ’…


⭐ Author ⭐

Generated automatically by Doxygen for libstdc++ from the source code.


and that's a wrap, bestie πŸŽ€ this whole page came out of libstdc++, auto-generated by Doxygen straight from the source code, and it's the std::experimental::propagate_const< _Tp >(3) page. go forth and propagate those consts πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms