std:: negate<void>
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Old binders and adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
헤더 파일에 정의됨
<functional>
|
||
|
template
<>
class negate < void > ; |
(C++14 이후) | |
std:: negate <> 는 매개변수와 반환 타입이 추론된 std::negate 의 특수화입니다.
목차 |
멤버 타입
| 타입 | 정의 |
is_transparent
|
unspecified |
멤버 함수
|
operator()
|
인자의 부호를 반전하여 반환합니다
(public member function) |
std::negate<void>:: operator()
|
template
<
class
T
>
constexpr
auto
operator
(
)
(
T
&&
arg
)
const
|
||
arg 의 부정(negation) 결과를 반환합니다.
매개변수
| arg | - | 부정할 값 |
반환 값
- std:: forward < T > ( arg ) .
예제
#include <complex> #include <functional> #include <iostream> int main() { auto complex_negate = std::negate<void>{}; // "void"는 생략 가능 constexpr std::complex z(4, 2); std::cout << z << '\n'; std::cout << -z << '\n'; std::cout << complex_negate(z) << '\n'; }
출력:
(4,2) (-4,-2) (-4,-2)