Show HN: Hexi – Modern header-only network binary serialisation for C++
11–20 of 49 posts
Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#12Your lib requires manually creating both a serializing and deserializing function. If the functions are out of sync, bad things happen. Consider copying Cereal, which solves this problem by requiring you to create a single templated function ( https://uscilab.github.io/cereal/ )
Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#13Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#14By the way I looked through the code, and had to read about metaprogramming in C++. I wonder why is it so complicated? For example, why constraints like std::is_integral are represented by structs. Doesn't make much sense to me. A function wouldn't be better here?
Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#15I know it's a convention since the inception of the language, but the operator overload abuse of the bitshift operator still makes me sad every time I see it :(
Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#16Wow that api looks fantastic! Bravo! I'd like to read an even more thorough overview of how it works and all the gotchas before I'd consider using this 'in production' but the API looks very easy to use and very elegant. EDIT: just hit the section on portability, seems like you would always have to use that API, yeah? I feel like when you are writing network code you simply have to make it portable from the get-go. I…
Thanks. The documentation could definitely be fleshed out with some more examples. You'd likely want to always use that API (or layer something on top of it) unless you're in control of both ends and know they were built with the same toolchain & settings. One area where I've skipped over it is by writing a basic code gen tool (albeit unfinished as most personal projects) that generates the serialisation functions at…
Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#17Your lib requires manually creating both a serializing and deserializing function. If the functions are out of sync, bad things happen. Consider copying Cereal, which solves this problem by requiring you to create a single templated function ( https://uscilab.github.io/cereal/ )
Thanks, that is definitely a downside to the shift operator overloading approach. I'll take that onboard and investigate whether a single operator to handle both would mesh with the current design.
Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#18By the way I looked through the code, and had to read about metaprogramming in C++. I wonder why is it so complicated? For example, why constraints like std::is_integral are represented by structs. Doesn't make much sense to me. A function wouldn't be better here?
Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#19I know it's a convention since the inception of the language, but the operator overload abuse of the bitshift operator still makes me sad every time I see it :(
Bjarne appears to prefer cout though, so it isn't universal.
Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#20By the way I looked through the code, and had to read about metaprogramming in C++. I wonder why is it so complicated? For example, why constraints like std::is_integral are represented by structs. Doesn't make much sense to me. A function wouldn't be better here?
Practically, it's all through this `type_traits` header that (often) end up in unreadable messes. It's all possible because of the catchy acronym SFINAE. It doesn't make much sense to me either, so I avoid it :) https://en.cppreference.com/w/cpp/language/sfinae