Fix MSVC 19.28+ issue with ByEdgeOrByMeterValue::by_edge and ByEdgeOrByMeterValue::by_meter definitions

This is a workaround for discrepancy between MSVC 19.27 and 19.28
about static const member definition
https://developercommunity2.visualstudio.com/t/discrepancy-between-msvc-1927-vs-1928-about-static/1255338

We can not use C++17 inline variable as a workaround suggested
in the issue report linked above, because the sol2 does not
seem to compile in C++17 mode:

    third_party/sol2/sol2/sol.hpp: error C2039: 'object_type': is not a member of...
This commit is contained in:
Mateusz Łoskot 2020-11-23 19:04:03 +01:00 committed by Mateusz Łoskot
parent a3f1c2afb0
commit 3da45c1d92
No known key found for this signature in database
GPG Key ID: 928D7C2ABB2AC1F2

View File

@ -25,6 +25,24 @@
#include <string> #include <string>
#include <vector> #include <vector>
#ifdef _MSC_VER
#if (_MSC_VER>=1928)
#ifdef _DEBUG
namespace osrm
{
namespace extractor
{
namespace detail
{
const ByEdgeOrByMeterValue::ValueByEdge ByEdgeOrByMeterValue::by_edge;
const ByEdgeOrByMeterValue::ValueByMeter ByEdgeOrByMeterValue::by_meter;
}
}
}
#endif
#endif
#endif
namespace osrm namespace osrm
{ {
namespace extractor namespace extractor