Post AMLvHTLJ4AQVzCbOnA by nicofee@fosstodon.org
 (DIR) More posts by nicofee@fosstodon.org
 (DIR) Post #AMLrPCtxg5bvUlFE5Q by calebccff@fosstodon.org
       2022-08-09T12:36:18Z
       
       0 likes, 0 repeats
       
       are there any nice ways to serialise complex structs in C++ without codegen? I'd love something generic that can recurse struct members and serialise them into a big byte arraybasically to do this without all the ugly codegen: https://github.com/aospm/qrild/blob/main/_android/qmi_uim.c#L47
       
 (DIR) Post #AMLrPsDC5UM9cHYfFw by calebccff@fosstodon.org
       2022-08-09T12:36:19Z
       
       0 likes, 0 repeats
       
       on a related note does C++ support  annotations?
       
 (DIR) Post #AMLsRtOQlaefoULBJ2 by wizzwizz4@fosstodon.org
       2022-08-09T12:48:02Z
       
       0 likes, 0 repeats
       
       @calebccff C++ doesn't have reflection, so it's not really possible. I've found a hackish close-enough solution, though: https://preshing.com/20180116/a-primitive-reflection-system-in-cpp-part-1/(Obligatory "Rust can do it with derive macros, like serde".)
       
 (DIR) Post #AMLvHTLJ4AQVzCbOnA by nicofee@fosstodon.org
       2022-08-09T13:19:45Z
       
       0 likes, 0 repeats
       
       @calebccff C++ does have attributes, which sounds like what you want
       
 (DIR) Post #AMLvfDq2MXe2qmIj3Y by nicofee@fosstodon.org
       2022-08-09T13:20:34Z
       
       0 likes, 0 repeats
       
       @calebccff https://docs.microsoft.com/cpp/cpp/attributes?view=msvc-170
       
 (DIR) Post #AMLvfEEqsHUi5juXjc by calebccff@fosstodon.org
       2022-08-09T13:24:01Z
       
       0 likes, 0 repeats
       
       @nicofee hmm, doesn't seem to support custom ones though, a quick Google didn't give me much confidence
       
 (DIR) Post #AMLxJUjD5MtYlqsJGa by calebccff@fosstodon.org
       2022-08-09T13:42:30Z
       
       0 likes, 0 repeats
       
       @wizzwizz4 this is super interesting, thanks.