STD::CONST_MEM_FUN1_T(3cxx)

πŸ’… NAME

ok so bestie, meet std::const_mem_fun1_t< _Ret, _Tp, _Arg > β€” it's literally one of the adaptors for member pointers. that's the whole vibe. it takes a pointer-to-const-member-function and makes it behave like a regular callable object. slay.

(this is the <functional> girlies' territory, section 3cxx of the manual, if you're keeping track πŸŽ€)


✨ SYNOPSIS ✨

first things first, you gotta let her in:

#include <functional>

and she inherits from std::binary_function< const _Tp *, _Arg, _Ret > β€” so everything that base class has? she's got it too. inherited, no cap. πŸ‘‘

🌸 Public Types

  • typedef const _Tp * first_argument_type β€” first_argument_type is the type of the first argument. yes, it's a const _Tp *. that asterisk is doing the heavy lifting fr.
  • typedef _Ret result_type β€” result_type is the return type. _Ret is the moment, _Ret is the main character.
  • typedef _Arg second_argument_type β€” second_argument_type is the type of the second argument. _Arg, you're literally second in line but still iconic.

πŸ¦‹ Public Member Functions

  • const_mem_fun1_t (_Ret(_Tp::*__pf)(_Arg) const) β€” the constructor, and its one job is holding onto a pointer to a const member function of _Tp that takes one _Arg and gives you back _Ret. that's it, that's the whole parameter. πŸ’…
  • _Ret operator() (const _Tp *__p, _Arg __x) const β€” the call operator. hand her a const _Tp * and an _Arg, she cashes in the stored member pointer and hands you back _Ret. this is the part where it all pays off, periodt.

πŸ’– Detailed Description

template<typename _Ret, typename _Tp, typename _Arg>
    class std::const_mem_fun1_t< _Ret, _Tp, _Arg >

the official tagline: "One of the adaptors for member pointers." short, sweet, gets straight to the point, we love her for it. πŸ’«

three template params, no more no less: _Ret (what comes back out), _Tp (the class the member lives on), _Arg (the one thing you feed it). that's the trio. iykyk.


πŸŽ€ Member Typedef Documentation

🌈 typedef const _Tp * std::binary_function< const _Tp * , _Arg , _Ret >::first_argument_type [inherited]

first_argument_type is the type of the first argument. inherited from std::binary_function< const _Tp * , _Arg , _Ret >, so, like, don't come for her for not declaring it herself. πŸ™ˆ

⭐ typedef _Ret std::binary_function< const _Tp * , _Arg , _Ret >::result_type [inherited]

result_type is the return type. also inherited. also a legend.

🧚 typedef _Arg std::binary_function< const _Tp * , _Arg , _Ret >::second_argument_type [inherited]

second_argument_type is the type of the second argument. third one, still carrying the team on inherited legs. we stan a consistent naming scheme. πŸ’œ


πŸ‘‘ Author

Generated automatically by Doxygen for libstdc++ from the source code. no human wrote this, it was the robots, and honestly? they ate. πŸ€–βœ¨


heads up bestie: this one's auto-generated documentation for libstdc++, i.e. the GNU C++ standard library. the wording is the compiler's, not mine β€” so if something looks terse, that's just the Doxygen aesthetic. πŸ’€

ok that's the whole page!! thanks for reading, written from the libstdc++ source code, documented via Doxygen, section 3cxx β€” mwah, see u in the next man page πŸ’…πŸ’–πŸŽ€

πŸ“¦ where this page comes from