This simplifies the serialization code a bit and should also make it a bit faster.
-
use fold expressions instead of recursive calls. This simplifies the code, makes it most likely faster because it reduces the number of function calls, and compiles faster because there are fewer template instantiations.
-
use
if constexpr
instead of unnecessarily creating a temporary object only to call the right overload. This is used forstd::vector
andprevector
serialization.