Skip to content

Commit 44ed6c0

Browse files
committed
Create test_serialize.cpp
1 parent 171e326 commit 44ed6c0

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Util/stdcxx26/test_serialize.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* @file test_serialize.cpp
3+
* @author Xuhua Huang
4+
* @brief
5+
* @version 0.1
6+
* @date 2025-06-20
7+
*
8+
* @copyright Copyright (c) 2025
9+
*
10+
*/
11+
12+
13+
#include "serialize.hpp"
14+
15+
#include <print>
16+
17+
struct Data {
18+
int x;
19+
int y;
20+
float z;
21+
std::string_view str;
22+
23+
static constexpr std::string_view names[]{
24+
"x", "y", "z", "str"
25+
};
26+
};
27+
28+
int main() {
29+
Data value{ .x = 1, .y = 2, .z = 4.3f, .str = "Hello World" };
30+
31+
util::inspect(value);
32+
util::serialize(value);
33+
return 0;
34+
}

0 commit comments

Comments
 (0)