std::plus<void>

Header: <functional>

std::plus is a specialization of std::plus with parameter and return type deduced.

# Declarations

template<>
class plus<void>;

(since C++14)

# Parameters

# Return value

std::forward(lhs) + std::forward(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';
}