namespace std {
template <class CharT, class Traits>
constexpr bool operator<=(basic_string_view<CharT, Traits> x,
basic_string_view<CharT, Traits> y) noexcept;
}
概要
basic_string_view
オブジェクトにおいて、左辺が右辺以下かの判定を行う。
戻り値
return x.compare(y) <= 0;
例
#include <iostream>
#include <string_view>
int main()
{
std::string_view a = "aaa";
std::string_view b = "bbb";
if (a <= b) {
std::cout << "less equal" << std::endl;
}
else {
std::cout << "greater" << std::endl;
}
}
出力例
less equal
バージョン
言語
- C++17
処理系
- Clang: 4.0
- GCC: 7.1
- ICC: ??
- Visual C++: ??