std::less_equal<void>
| 헤더 <functional>
|
||
template<>
class less_equal<void>;
|
(C++14부터)에 정의됨 | |
std::less_equal<void>는 std::less_equal의 특수화로, 매개변수와 반환 타입이 추론됩니다.
중첩 타입
| 중첩 타입 | 정의 |
is_transparent
|
unspecified |
멤버 함수
|
operator()
|
lhs
가
rhs
보다 작거나 같은지 검사합니다
(public member function) |
std::less_equal<void>:: operator()
|
template
<
class
T,
class
U
>
constexpr
auto
operator
(
)
(
T
&&
lhs, U
&&
rhs
)
const
|
||
std:: forward < T > ( lhs ) <= std:: forward < U > ( rhs ) 의 결과를 반환합니다.
매개변수
| lhs, rhs | - | 비교할 값들 |
반환 값
std:: forward < T > ( lhs ) <= std:: forward < U > ( rhs ) .
포인터를 비교하는 내장 연산자가 호출되는 경우, 그 결과는 구현에서 정의된 포인터에 대한 엄격한 전체 순서 와 일관됩니다.
예외
구현에서 정의된 예외를 던질 수 있습니다.
예제
#include <algorithm> #include <functional> #include <initializer_list> constexpr bool strictly_not_positive(int lhs) { return std::less_equal<>()(lhs, 0); } int main() { constexpr int low = 0, high = 8; std::less_equal<> less_equal{}; static_assert(less_equal(low, high)); static_assert(less_equal(low, low)); static constexpr auto arr = {1, 0, -1, -2, -3, -4}; static_assert(!std::all_of(arr.begin(), arr.end(), strictly_not_positive)); static_assert(std::all_of(arr.begin() + 1, arr.end(), strictly_not_positive)); }
결함 보고서
다음의 동작 변경 결함 보고서들은 이전에 발표된 C++ 표준에 소급 적용되었습니다.
| DR | 적용 대상 | 게시된 동작 | 올바른 동작 |
|---|---|---|---|
| LWG 2562 | C++98 | 포인터 전체 순서가 일관되지 않을 수 있음 | 일관성 보장됨 |