cereal
cereal copied to clipboard
Remove template parameter `Archive` from `InputBindingsMap` and `OutputBindingsMap`
Archive isn't directly needed for any content in binding
structs and required only to instantiate different global static
maps for different archives.
This commit turns InputBindingsMap and OutputBindingsMap into
non-templated structs and modifies binding maps to include archive's
typeid, such that they describe relation: typeid(Archive) -> per-archive binding map.
That way only two global static objects will be created in runtime (for input and output bindings respectively) in each library/executable. Also types of these globals are independent from included archives and known beforehand.
Reason for this change is discussed in issue #508
I know that there's one non-related commit with suppressing warnings, but what do you think about the main idea?
It literally changes nothing in public API, but at the same time allows me to unify serialization code across multiple shared libraries.
If this works as you say, it would be a great addition since I currently am doing some funky work arounds to make this work correctly across shared library boundaries.
@dtmoodie I successfully apply this patch and use it in my project exactly to "unite" serialization code from multiple shared libraries at runtime. Works fine. Because patch is relatively simple and non-affecting. Try it.
Great PR!! @AzothAmmo What is missing to accept the merge?
Does this PR still have a chance of being merged? We are facing the same problem as @uentity (separate shared libraries) and we would love to either see this integrated. A workaround would also be great!
@AzothAmmo I am also willing to rebase the PR if necessary. Thanks!
Edit: turns out the rebase is trivial. The rebased code is here.
Edit 2: I have opened a new PR (#812).