TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25188 19
Your C++ struct is the schema: a proto3 serializer in C++26 reflection

I built a header-only proto3 wire-format library with one constraint: no .proto files, no codegen, no descriptor runtime. The user writes a plain C++ struct, and that struct is the schema:

#include "proto3.hpp"
struct SearchRequest {
std::string query; // field 1
std::int32_t page_number; // field 2
std::int32_t results_per_page; // field 3
};
SearchRequest req{"hello", 1, 10};
std::string bytes = proto3::serialize(req); // -> proto3 wire bytes
SearchRequest back = proto3::deserialize<SearchRequest>(bytes);


blog: Your C++ struct is the schema: a proto3 serializer in C++26 reflection

github: struct\_proto26

https://redd.it/1tcrfz4
@r_cpp
PikachuHy's Blog Your C++ struct is the schema: a proto3 serializer in C++26 reflection I built a header-only proto3 wire-format library with one constraint: no .proto files, no codegen, no descriptor runtime. The user writes a plain C++ struct, and that struct is the schema:
More from @r_cpp
  1. Oct 3, 2026Lets explore the stack https://meetingcpp.com/blog/items/Lets-explore-the-stack.html https…
  2. Oct 3, 2026C++ Show and Tell - October 2026 Use this thread to share anything you've written in C++.…
  3. Oct 3, 2026C++ future at Adobe So if anyone was still curious what happened to Hylo, or where Adobe s…
  4. Oct 3, 2026C++ Jobs - Q4 2026 Rules For Individuals --------------------- * **Don't** create top-leve…
  5. Sep 29, 2026Boost.Graph 1.95 will be C++17 Dear Boost.Graph community, In two release cycles (Boost re…
  6. Sep 26, 2026Token Sequence Injection & Modern Macros: The Most Game-Changing Compile-Time Feature in C…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →