std::plus<void> - cppreference.com
From cppreference.com
|
|
(since C++14) | |
std::plus<void> is a specialization of std::plus with parameter and return type deduced.
Member types
Member functions
std::plus<void>::operator()
|
|
||
Returns the sum of lhs and rhs.
Parameters
Return value
std::forward<T>(lhs) + std::forward<U>(rhs).
Example
#include <functional> #include <iostream> int main() { auto string_plus = std::plus<void>{}; // “void” can be omitted std::string a = "Hello "; const char* b = "world"; std::cout << string_plus(a, b) << '\n'; }
Output: