template <class Allocator2>
friend bool operator==(const basic_stacktrace& x,
const basic_stacktrace<Allocator2>& y) noexcept;
概要
basic_stacktrace
同士の等値比較を行う。
戻り値
備考
- この演算子により、
operator!=
が使用可能になる
例
#include <cassert>
#include <stacktrace>
void g() {
std::stacktrace a = std::stacktrace::current();
std::stacktrace b = std::stacktrace::current();
std::stacktrace c = a;
assert(a == c);
assert(a != b);
}
void f() {
g();
}
int main() {
f();
}
20
#include <cassert>
#include <stacktrace>
void g() {
std::stacktrace a = std::stacktrace::current();
std::stacktrace b = std::stacktrace::current();
std::stacktrace c = a;
assert(a == c);
assert(a != b);
}
void f() {
g();
}
int main() {
f();
出力
バージョン
言語
- C++23
処理系
- Clang: ??
- GCC: 12 ✅
- Visual C++: ??