std:: plus<void>
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Old binders and adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
헤더에 정의됨
<functional>
|
||
|
template
<>
class plus < void > ; |
(C++14 이후) | |
std:: plus < void > 는 매개변수와 반환 타입이 추론된 std::plus 의 특수화입니다.
목차 |
멤버 타입
| 타입 | 정의 |
is_transparent
|
unspecified |
멤버 함수
|
operator()
|
두 인자의 합을 반환합니다
(public member function) |
std::plus<void>:: operator()
|
template
<
class
T,
class
U
>
constexpr
auto
operator
(
)
(
T
&&
lhs, U
&&
rhs
)
const
|
||
lhs 와 rhs 의 합을 반환합니다.
매개변수
| lhs, rhs | - | 합산할 값들 |
반환 값
std:: forward < T > ( lhs ) + std:: forward < U > ( rhs ) .
예제
#include <functional> #include <iostream> int main() { auto string_plus = std::plus<void>{}; // "void"는 생략 가능 std::string a = "Hello "; const char* b = "world"; std::cout << string_plus(a, b) << '\n'; }
출력:
Hello world