USCiLab / cereal

A C++11 library for serialization
BSD 3-Clause "New" or "Revised" License
4.25k stars 767 forks source link

RapidJson causes C5054 on MSVC #821

Open dpservis opened 6 months ago

dpservis commented 6 months ago

Hello,

The embedded version of RapidJson causes C5054 warnings on MSVC with C++20. They have fixed it on their side using static casts. Is it possible to update the library in Cereal?

Thanks

Dimitris

sldr commented 2 months ago

Workaround (surround any include giving you the problem):

#ifdef _WIN32
#pragma warning(push)
#pragma warning(disable: 5054) // Include\cereal\external\rapidjson\document.h does '|' with two different enum types
#endif
#include <cereal/archives/json.hpp>
#ifdef _WIN32
#pragma warning(pop)
#endif