-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Put rapidjson under cereal
namespace
#534
Comments
You can provide a definition for |
@AzothAmmo thank you! I did this already for myself but my point is that Cereal should be shipped with rapidjson under cereal namespace by default. The purpose of this is to avoid collision with target project’s rapidjson definitions, which is not a rare case since rapidjson is so widely used. |
IMHO it should not be shipped internally at all. This is what we have git-submodules, build systems and package managers for. |
Please fix this "I include and mess up library x" issue, it is impossible to use both rapidjson and cereal in vcpkg since cereal has adds a lot of mods in rapidjson. |
A library should not bundle/package other libraries, otherwise we can very easily get the diamond problem and ODR violations. For example, on Ubuntu or Debian, if you install #include <cereal/archives/json.hpp>
#include <rapidjson/document.h>
int main() {} The real solution is to use CMake's Other solution is to define |
If #604 addresses this would really appreciate it getting merged. |
Before the last update of RapidJSON, it was placed under
cereal::rapidjson
namespace to avoid collisions with other versions of RapidJSON in the same binary, which was very handy. Unfortunately, it's not the case anymore, now Cereal's RapidJSON is defined under its default namespacerapidjson
so it conflicts with other RapidJSONs. I propose to putcereal::rapidjson
namespace back.The fix is just to update three lines in
include/cereal/external/rapidjson/rapidjson.h
. I can send a PR if needed.The text was updated successfully, but these errors were encountered: