_NOT_FN(3)

πŸ“¦ version 16.2.1, in centos-stream 9

πŸ’… _Not_fn< _Fn >(3) β€” Library Functions Manual

okay so bestie, sit down, because we're about to get into _Not_fn< _Fn >, and it is exactly what it sounds like: a Generalized negator. That's the whole vibe. It negates stuff. Generally. ✨


🌸 NAME

_Not_fn< _Fn > β€” Generalized negator. That's it, that's the whole personality. πŸŽ€


✨ SYNOPSIS

🫢 Public Member Functions

  • The big constructor β€” takes your callable and a sneaky int:
template<typename _Fn2 > constexpr _Not_fn (_Fn2 &&__fn, int)
  • Move constructor β€” defaulted, so you don't gotta write it yourself, king:
_Not_fn (_Not_fn &&__fn)=default
  • Copy constructor β€” also defaulted. Free real estate:
_Not_fn (const _Not_fn &__fn)=default
  • operator() on an rvalue, but =deleted β€” it only exists when the thing is not invocable, which is the compiler's way of saying "nah bestie, this one's off the menu":
template<typename... _Args, typename  = enable_if_t<!__is_invocable<_Fn && , _Args...>::value>> void operator() (_Args &&... __args) &&=delete
  • operator() on an lvalue, =deleted β€” same deal, !__is_invocable check, gone:
template<typename... _Args, typename  = enable_if_t<!__is_invocable<_Fn & , _Args...>::value>> void operator() (_Args &&... __args) &=delete
  • operator() const &&, =deleted β€” deleted era πŸ’€:
template<typename... _Args, typename  = enable_if_t<!__is_invocable<_Fn const && , _Args...>::value>> void operator() (_Args &&... __args) const &&=delete
  • operator() const &, =deleted β€” last of the deleted squad, still const &:
template<typename... _Args, typename  = enable_if_t<!__is_invocable<_Fn const & , _Args...>::value>> void operator() (_Args &&... __args) const &=delete

πŸ¦‹ Public Attributes

these next four are the ones that actually slay β€” they light up when __is_invocable is true, and they're all constexpr with noexcept specs that read like a whole paragraph. no cap, copy them character for character or the vibe check fails πŸ™ˆ

  • rvalue operator() β€” the && one, all constexpr'd up and noexcept-chain'd through _Fn &&:
template<typename... _Args, typename  = enable_if_t<__is_invocable<_Fn && , _Args...>::value>> constexpr decltype(_S_not< __inv_res_t< _Fn &&, _Args... >>()) operator() (_Args &&... __args) &&noexcept(__is_nothrow_invocable< _Fn &&, _Args... >::value &&noexcept(_S_not< __inv_res_t< _Fn &&, _Args... >>()))
  • lvalue operator() β€” the & one, same energy but for _Fn &:
template<typename... _Args, typename  = enable_if_t<__is_invocable<_Fn & , _Args...>::value>> constexpr decltype(_S_not< __inv_res_t< _Fn &, _Args... >>()) operator() (_Args &&... __args) &noexcept(__is_nothrow_invocable< _Fn &, _Args... >::value &&noexcept(_S_not< __inv_res_t< _Fn &, _Args... >>()))
  • const rvalue operator() β€” _Fn const && edition, iconic, no notes πŸ‘‘
template<typename... _Args, typename  = enable_if_t<__is_invocable<_Fn const && , _Args...>::value>> constexpr decltype(_S_not< __inv_res_t< _Fn const &&, _Args... >>()) operator() (_Args &&... __args) const &&noexcept(__is_nothrow_invocable< _Fn const &&, _Args... >::value &&noexcept(_S_not< __inv_res_t< _Fn const &&, _Args... >>()))
  • const lvalue operator() β€” _Fn const &, the final form, the main character 🌟:
template<typename... _Args, typename  = enable_if_t<__is_invocable<_Fn const & , _Args...>::value>> constexpr decltype(_S_not< __inv_res_t< _Fn const &, _Args... >>()) operator() (_Args &&... __args) const &noexcept(__is_nothrow_invocable< _Fn const &, _Args... >::value &&noexcept(_S_not< __inv_res_t< _Fn const &, _Args... >>()))
fr fr, every one of those signatures is constexpr, every one carries a noexcept(...) made of an __is_nothrow_invocable<...>::value and a noexcept(_S_not<...>()), and every enable_if_t gate is spelled out above exactly as it lives in the header. don't @ me, just copy it πŸ’…

🧚 Detailed Description

okay here's the actual declaration, and yes, the stray quote mark is canon, it's part of the lore:

template<typename _Fn>
    class _Not_fn< _Fn >" Generalized negator.

so yeah β€” template<typename _Fn>, class _Not_fn< _Fn >, and the whole bit is a Generalized negator. that's the sentence. that's the description. she's short, she's sweet, she's a template. obsessed. πŸ’–


🌈 Author

Generated automatically by Doxygen for libstdc++ from the source code. so nobody hand-wrote this one β€” it's a bot's magnum opus, and honestly? it ate. πŸ”₯


randomly thinking about how this page is libstdc++, dated Wed Oct 7 2026, and lives at _Not_fn< _Fn >(3) β€” anyway bestie, go negate something, you've got this πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from
  • centos-stream 9: gcc-toolset-16-libstdc++-docs 16.2.1-1.3.el9 Β· 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-1017 on : a language model's rewrite of the original, under its terms