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__xand__yand hands you back the sum, and she does itconstexpr-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
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms