std:: plus<void>
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Old binders and adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Definiert in Header
<functional>
|
||
|
template
<>
class plus < void > ; |
(seit C++14) | |
std:: plus < void > ist eine Spezialisierung von std::plus mit abgeleitetem Parameter- und Rückgabetyp.
Inhaltsverzeichnis |
Mitgliedertypen
| Typ | Definition |
is_transparent
|
unspecified |
Memberfunktionen
|
operator()
|
gibt die Summe der beiden Argumente zurück
(öffentliche Elementfunktion) |
std::plus<void>:: operator()
|
template
<
class
T,
class
U
>
constexpr
auto
operator
(
)
(
T
&&
lhs, U
&&
rhs
)
const
|
||
Gibt die Summe von lhs und rhs zurück.
Parameter
| lhs, rhs | - | zu summierende Werte |
Rückgabewert
std:: forward < T > ( lhs ) + std:: forward < U > ( rhs ) .
Beispiel
#include <functional> #include <iostream> int main() { auto string_plus = std::plus<void>{}; // "void" kann weggelassen werden std::string a = "Hello "; const char* b = "world"; std::cout << string_plus(a, b) << '\n'; }
Ausgabe:
Hello world