The following generated code is based primarily on this file:#pragma once#include<SendBuffer.hh>#includeudp_stuff.hh#include<string_plus.hh>namespace middle_front{inline void Marshal (::cmw::SendBuffer& buf     ,bool az1     ,int32_t max_length=cmw::udp_packet_max){  try{    buf.ReserveBytes(4);    buf.Receive(az1);    buf.FillInSize(max_length);  }catch(...){buf.Rollback();throw;}}void Marshal (::cmw::SendBuffer& buf     ,bool az1     ,cmw::string_plus const& az2     ,int32_t max_length=cmw::udp_packet_max){  try{    buf.ReserveBytes(4);    buf.Receive(az1);    az2.Marshal(buf);    buf.FillInSize(max_length);  }catch(...){buf.Rollback();throw;}}}There are two messages that I send from my middle tier to my front tier. I've been reworking the above code to have one higher level function that has the try/catch and two lower-level functions that take the same input as the two functions above, but are simpler:#pragma once// Code generated by the C++ Middleware Writer version 1.14.#include<SendBuffer.hh>#includeudp_stuff.hh#include<string_plus.hh>namespace middle_front{inline int32_t Marsh (::cmw::SendBuffer& buf     ,bool az1){  buf.Receive(az1);  return cmw::udp_packet_max;}inline int32_t Marsh (::cmw::SendBuffer& buf     ,bool az1     ,cmw::string_plus const& az2){  buf.Receive(az1);  az2.Marshal(buf);  return cmw::udp_packet_max;}template<typename... T>void Marshal (::cmw::SendBuffer& buf,T&&... t){  try{    buf.ReserveBytes(4);    auto max_length=Marsh(buf,t...);    buf.FillInSize(max_length);  }catch(...){buf.Rollback();throw;}}}Building two executables in this directory (after making the same change to two other files) results in slightly smaller text segments for both of the executables. There's also fewer total characters in the new variadic-based approach.I was happy with how things were going, but then I made the same change to this file. With g++ 7.1.1, g++ 8.0.0, and clang++ 4.0.0 on FreeBSD (TrueOS), the size of an executable that uses the above file, increases by over 1%. I've tried different combinations of marking the low-level functions as inline or leaving that off, but that hasn't made much difference.My assessment of the refactoring is:More scalable than my current approach (less code) when there are two or more messages to sendMakes the code easier to readIn two apps it slightly reduces the size of the text segment, but in another it increases the size by over 1%If I hadn't gone on to the example code and tested the change there, I would have no qualms about this change, but now have some hesitation with it. Is there something about the new version I could try to change?  Do you think the compilers are weak with this one application, but should eventually improve? I don't have clang 5, but could try with that at some point.Edit:I should remove max_length here:auto max_length=Marsh(buf,t...);buf.FillInSize(max_length);Edit 2:The version that uses variadics is here.And at least for a while, the original version is here.Edit 3:After listening to Howard Hinnant on cppcast.com, I changed this line:auto max_length=Marsh(buf,t...);to:auto max_length=Marsh(buf,::std::forward(t)...);.  That didn't affect the sizes of the executables, but I think it's needed.
Messaging and serialization library
c++;c++11;serialization