Show HN: Hexi – Modern header-only network binary serialisation for C++
31–40 of 49 posts
Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#32By 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?
Because the only way to do metaprogramming in C++ is via the type system. Thismakes it so you need to implement 'functions' as types.
Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#33Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#34Earlier quoted context omitted.
Because the only way to do metaprogramming in C++ is via the type system. Thismakes it so you need to implement 'functions' as types.
What does that mean, and is it even true, given template value parameters or constexpr for example?
> What does that mean
Have you ever noticed that the (compile time) "rules" for interacting with templated functions are somewhat different from those of non-templated functions? I don't know if "functions as types" is entirely fair but there is definitely some weirdness.
Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#35Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#36I 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 :(
Array programming languages smugly enter the chat
Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#37But soon you’ll be bitten by the fact you don’t have a schema and so you’ll move to something like Protobuf or the more efficient FlatBuffers
Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#38If you need schema-less serialiation there’s MessagePack. But soon you’ll be bitten by the fact you don’t have a schema and so you’ll move to something like Protobuf or the more efficient FlatBuffers
Re: Show HN: Hexi – Modern header-only network binary serialisation for C++
#39By 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?
Because the only way to do metaprogramming in C++ is via the type system. Thismakes it so you need to implement 'functions' as types.