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 << "not equal" << std::endl;
}
else {
std::cout << "equal" << std::endl;
}
}
出力例
not equal
バージョン
言語
- C++17
処理系
- Clang: 4.0
- GCC: 7.1
- ICC: ??
- Visual C++: ??