-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.cpp
More file actions
39 lines (30 loc) · 1 KB
/
hello.cpp
File metadata and controls
39 lines (30 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "x86_64-unknown-linux-gnu/include/zstd.h"
#include <iostream>
#include <zstd.h>
#include <brotli/encode.h>
#include <brotli/decode.h>
#include <compare> // Required for comparison category types
class MyClass {
public:
int value;
// ... other members
// Define the three-way comparison operator
auto operator<=>(const MyClass& other) const {
return value <=> other.value; // Compares the 'value' member
}
};
int main() {
MyClass obj1{10};
MyClass obj2{20};
if (obj1 < obj2) { // This uses the synthesized operator<
std::cout << "Test1\n";
}
// You can also directly use the result of operator<=>
std::strong_ordering result = obj1 <=> obj2;
if (result == std::strong_ordering::less) {
std::cout << "Test2\n";
}
std::cout << "ZSTD " << ZSTD_versionNumber() << " " << &ZSTD_compress2 << " " << &ZSTD_decompress << "\n";
std::cout << "Brotli " << &BrotliDecoderDecompress << " " << &BrotliEncoderCompress << "\n";
return 0;
}