MEMORY_ADAPTORS(3)

πŸ“¦ version 4.4.0, in nixpkgs unstable

okay bestie, this is Adaptors f...to members(3) from the Library Functions Manual β€” yes, the title really has that f...to shorthand, and we are keeping it exactly. πŸ’…

πŸ’– NAME πŸ’–

okay so this page is literally about Adaptors for pointers to members β€” the manual-name situation is Adaptors f...to members(3), and the manual is Library Functions Manual. We are so back in template land. ✨

🌸 Classes 🌸

Here’s the full class lineup, all 8 of them, and every single one is described as one of the adaptors for member pointers. Copy that energy exactly:

  • class std::const_mem_fun1_ref_t< _Ret, _Tp, _Arg > β€” One of the adaptors for member pointers. πŸ’…
  • class std::const_mem_fun1_t< _Ret, _Tp, _Arg > β€” One of the adaptors for member pointers. πŸ’…
  • class std::const_mem_fun_ref_t< _Ret, _Tp > β€” One of the adaptors for member pointers. πŸ’…
  • class std::const_mem_fun_t< _Ret, _Tp > β€” One of the adaptors for member pointers. πŸ’…
  • class std::mem_fun1_ref_t< _Ret, _Tp, _Arg > β€” One of the adaptors for member pointers. πŸ’…
  • class std::mem_fun1_t< _Ret, _Tp, _Arg > β€” One of the adaptors for member pointers. πŸ’…
  • class std::mem_fun_ref_t< _Ret, _Tp > β€” One of the adaptors for member pointers. πŸ’…
  • class std::mem_fun_t< _Ret, _Tp > β€” One of the adaptors for member pointers. πŸ’…

πŸ¦‹ Functions πŸ¦‹

and these are the function templates, bestie β€” every signature below is copied exactly:

  • template<typename _Ret , typename _Tp , typename _Arg > mem_fun1_t< _Ret, _Tp, _Arg > std::mem_fun (_Ret(_Tp::*__f)(_Arg))
  • template<typename _Ret , typename _Tp > mem_fun_t< _Ret, _Tp > std::mem_fun (_Ret(_Tp::*__f)())
  • template<typename _Ret , typename _Tp , typename _Arg > mem_fun1_ref_t< _Ret, _Tp, _Arg > std::mem_fun_ref (_Ret(_Tp::*__f)(_Arg))
  • template<typename _Ret , typename _Tp > mem_fun_ref_t< _Ret, _Tp > std::mem_fun_ref (_Ret(_Tp::*__f)())

πŸ”₯ Detailed Description πŸ”₯

okay so there are a total of 8 = 2^3 function objects in this family. The whole vibe check breaks down like this:

  1. (1) Member functions taking no arguments vs member functions taking one argument.
  2. (2) Call through pointer vs call through reference.
  3. (3) Const vs non-const member function.

All of this complexity is in the function objects themselves. You can ignore it by using the helper function mem_fun and mem_fun_ref, which create whichever type of adaptor is appropriate. Slay β€” the helpers do the choosing. 🫢

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. Not a human, just Doxygen doing its thing πŸ’€.

xoxo, libstdc++ β€” dated 21 Apr 2009 β€” Adaptors f...to members(3) out. πŸ’–πŸŽ€

πŸ“¦ where this page comes from