STD::PLUS(3cxx)

πŸ’– std::plus< _Tp > β€” the math functor page, bestie edition πŸ’–

okay so real talk, this is the manual page for std::plus< _Tp > from the 3cxx manual, and it's basically the ✨original✨ "just add two things together" icon. it lives in the libstdc++ universe and honestly? she's simple, she's classic, she's giving main character energy for every fold expression you've ever written. πŸŽ€


🌸 NAME 🌸

std::plus< _Tp > β€” literally one of the math functors. that's the whole vibe. πŸ’…


✨ SYNOPSIS ✨

#include <functional>

so first things first, she's in <functional>. include it or she will not show up, and that's on periodt. 🫢

Inherits std::binary_function< _Tp, _Tp, _Tp >.

Inherited by __gnu_parallel::_Plus< _Tp, _Tp, _Tp >.

like, she's part of a whole family tree. the parallel version literally descended from her. royalty recognizing royalty. πŸ‘‘

πŸ¦‹ Public Types πŸ¦‹

  • typedef _Tp first_argument_type β€” this typedef is the type of the first argument. no cap, that's what it is.
  • typedef _Tp result_type β€” this typedef is the return type. the whole "what comes out of her" energy.
  • typedef _Tp second_argument_type β€” this typedef is the type of the second argument. the other half of the duo. πŸ’–

🌈 Public Member Functions 🌈

  • constexpr _Tp operator() (const _Tp &__x, const _Tp &__y) const β€” returns the sum. that's it. that's the function. she adds __x and __y and hands you back the sum, and she does it constexpr-style so the compiler can be obsessed with her too. ⭐

πŸ’œ Detailed Description πŸ’œ

template<typename _Tp>
    struct std::plus< _Tp >

"One of the math functors." β€” the docs, being iconic and mysterious about it. 🧚

like yeah, that's the entire detailed description. the author really said "she needs no introduction" and closed the tab. πŸ™ˆ


πŸŽ€ Member Typedef Documentation πŸŽ€

these three are all [inherited], meaning she got them from her parent, and they're all typed as _Tp on std::binary_function< _Tp , _Tp , _Tp >. cute family inheritance moment. πŸ“

typedef _Tp std::binary_function< _Tp , _Tp , _Tp >::first_argument_type

[inherited] β€” first_argument_type is the type of the first argument. πŸ’–

typedef _Tp std::binary_function< _Tp , _Tp , _Tp >::result_type

[inherited] β€” result_type is the return type. ✨

typedef _Tp std::binary_function< _Tp , _Tp , _Tp >::second_argument_type

[inherited] β€” second_argument_type is the type of the second argument. πŸ¦‹

ngl, the docs just repeat the exact same three sentences here that they said up top. not me noticing the copy-paste bestie. πŸ’€ but fr fr, the info is the info, so here it is again in her honor.

πŸ”₯ Member Function Documentation πŸ”₯

template<typename _Tp > constexpr _Tp std::plus< _Tp >::operator() (const _Tp & __x, const _Tp & __y) const [inline], [constexpr]

Returns the sum. 🫢

she's [inline], she's [constexpr], she takes two const refs named __x and __y, and she gives you back the sum. two little underscores in front of the names because that's just how libstdc++ names her parameters. respect the convention. 🌸


πŸ‘‘ Author πŸ‘‘

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

(so like, a robot wrote this one. no human author to thank. the robot ate, honestly. πŸ€–βœ¨)


and that's the whole page bestie!! this doc came to you straight from libstdc++, living in the 3cxx manual alongside her, and she ate and left absolutely no crumbs. go forth and std::plus something. πŸ’…πŸŽ€πŸŒˆ

πŸ“¦ where this page comes from