STD::_MAYBE_UNARY_OR_BINARY_FUNCTION(3cxx)

πŸ“¦
version 9.5.0 Β· 3 versions
, in ubuntu noble

πŸ’– NAME πŸ’–

std::_Maybe_unary_or_binary_function< _Res, _ArgTypes > β€” bestie, this is a lil helper template from the C++ standard library, and it lives in the 3cxx manual, okurrr ✨


🌸 SYNOPSIS 🌸

#include <refwrap.h>

That's literally it. One include. Iconic behaviour fr fr πŸ’…


πŸ¦‹ Detailed Description πŸ¦‹

Okay so picture this template:

template<typename _Res, typename... _ArgTypes>
    struct std::_Maybe_unary_or_binary_function< _Res, _ArgTypes >

Not me being obsessed with a struct that literally just... decides what to inherit from 😭

Here's the vibe: it derives from unary_function or binary_function, or perhaps nothing, depending on the number of arguments provided. So like, it does a vibe check on how many _ArgTypes you handed it and then picks its ancestry accordingly. Slay πŸ’…

And the primary template is the basis case, which derives nothing. So if you don't match a specialization, you get the base case, and the base case is giving absolutely nothing. No inheritance, no drama, just a struct standing there. Main character energy but make it empty ✨

Definition at line 53 of file refwrap.h.

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. So technically no human wrote this page β€” it was birthed by a documentation generator, and honestly? It ate πŸ“


And that's the whole page, bestie 🫢 This little cutie came to you straight from libstdc++, documented for the 3cxx manual by the Doxygen autogen machine itself β€” no cap, that's genuinely where it came from πŸ’œπŸŽ€

πŸ“¦ where this page comes from