Template specializations produced by the macros apparently must be in the same namespace for GCC (not sure whether this is actually enforced by the standard).
Makes sense for binary (de)serialization, not sure about JSON (de)serialization