STD::MINUS(3cxx)

๐Ÿ’… std::minus< _Tp > โ€” bestie, it's the minus functor

okay so real talk, this is a page out of the libstdc++ manual โ€” the 3cxx section, to be exact โ€” and it's all about std::minus< _Tp >. math functors, babe. we love to see it. ๐Ÿงฎโœจ


โœจ NAME โœจ

std::minus< _Tp > โ€” literally one of the math functors. that's the whole vibe check. ๐Ÿซถ


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

#include <functional>

Inherits std::binary_function< _Tp, _Tp, _Tp >. yes she has a whole family tree, we'll get to that. ๐ŸŒธ

๐Ÿ’– Public Types

  • typedef _Tp first_argument_type โ€” first_argument_type is the type of the first argument. iconic of her to announce it like that.
  • typedef _Tp result_type โ€” result_type is the return type. obviously. no cap. ๐Ÿ‘‘
  • typedef _Tp second_argument_type โ€” second_argument_type is the type of the second argument. the sequel. the second act. ๐Ÿฆ‹

๐ŸŒˆ Public Member Functions

  • constexpr _Tp operator() (const _Tp &__x, const _Tp &__y) const โ€” this is the actual main character right here. she takes two const-ref args, __x and __y, and hands you back a _Tp. and she's constexpr and const, so she's well-behaved. ๐Ÿ’…

๐Ÿ”ฅ Detailed Description ๐Ÿ”ฅ

template<typename _Tp>
    struct std::minus< _Tp >"One of the math functors.
okay the stray " in there is fr fr how it shows up in the original source. not me inventing punctuation. leave her alone she's doing her best. ๐Ÿ˜ญ

๐Ÿ’œ Member Typedef Documentation ๐Ÿ’œ

these three are [inherited] โ€” she didn't invent them, she got them from std::binary_function< _Tp , _Tp , _Tp >, and honestly? hand-me-downs can still slay. ๐ŸŽ€

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.


โญ Author โญ

Generated automatically by Doxygen for libstdc++ from the source code. so technically no human wrote this, which is honestly so relatable โ€” the algorithm did the work and she ate. ๐Ÿค–๐Ÿ’…


that's the whole page bestie, go subtract something. ๐Ÿ“

sign-off szn: this was std::minus< _Tp >(3cxx) from the libstdc++ manual โ€” same name up top, same name at the bottom, bookended like a proper glow-up. ๐Ÿ’–โœจ๐Ÿฆ‹
๐Ÿ“ฆ where this page comes from