From 8a092891eccaab2eb91a0a373da7feada44ed46e Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Mon, 14 Nov 2022 16:46:50 -0500 Subject: [PATCH] Add a patch that will hopefully help MSVC debugging. --- src/mlpack/base.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mlpack/base.hpp b/src/mlpack/base.hpp index 4879167814..151a59b589 100644 --- a/src/mlpack/base.hpp +++ b/src/mlpack/base.hpp @@ -69,12 +69,14 @@ // Backport std::any from C+17 to C++11 to replace boost::any. // Use mnmlstc backport implementation only if compiler does not // support C++17. -#if __cplusplus < 201703L +#if __cplusplus < 201703L && !defined(_MSC_VER) #include #include #define MLPACK_ANY core::v2::any #define MLPACK_ANY_CAST core::v2::any_cast #define MLPACK_STRING_VIEW core::v2::string_view +#elif __cplusplus < 201703L && defined(_MSC_VER) + #error "When using Visual Studio, mlpack should be compiled with /Zc:__cplusplus and /std:c++17 or newer." #else #include #include