From b8e3403fd86c48b8ceef64aa6fd01da6cf9cbe3b Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Wed, 27 Dec 2023 18:55:33 -0800 Subject: [PATCH] Workaround MSVC's wrong `__cplusplus` value --- include/fast_matrix_market/app/array.hpp | 4 ++-- include/fast_matrix_market/app/doublet.hpp | 4 ++-- include/fast_matrix_market/app/triplet.hpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/fast_matrix_market/app/array.hpp b/include/fast_matrix_market/app/array.hpp index cb5045d..ca8aa7b 100644 --- a/include/fast_matrix_market/app/array.hpp +++ b/include/fast_matrix_market/app/array.hpp @@ -8,7 +8,7 @@ namespace fast_matrix_market { -#if __cplusplus >= 202002L +#if __cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) // If available, use C++20 concepts for programmer clarity and better error messages. // If not using C++20 this shows what fast_matrix_market expects each template type to support. @@ -118,7 +118,7 @@ namespace fast_matrix_market { write_body(os, formatter, options); } -#if __cplusplus < 202002L +#if __cplusplus < 202002L || (defined(_MSVC_LANG) && _MSVC_LANG < 202002L) // clean up after ourselves #undef array_read_vector #undef array_write_vector diff --git a/include/fast_matrix_market/app/doublet.hpp b/include/fast_matrix_market/app/doublet.hpp index 88c11ae..6e7292a 100644 --- a/include/fast_matrix_market/app/doublet.hpp +++ b/include/fast_matrix_market/app/doublet.hpp @@ -7,7 +7,7 @@ #include "../fast_matrix_market.hpp" namespace fast_matrix_market { -#if __cplusplus >= 202002L +#if __cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) // If available, use C++20 concepts for programmer clarity. // This shows what fast_matrix_market expects each template type to support. @@ -104,7 +104,7 @@ namespace fast_matrix_market { write_body(os, formatter, options); } -#if __cplusplus < 202002L +#if __cplusplus < 202002L || (defined(_MSVC_LANG) && _MSVC_LANG < 202002L) // clean up after ourselves #undef doublet_read_vector #undef doublet_write_vector diff --git a/include/fast_matrix_market/app/triplet.hpp b/include/fast_matrix_market/app/triplet.hpp index 871305c..331db86 100644 --- a/include/fast_matrix_market/app/triplet.hpp +++ b/include/fast_matrix_market/app/triplet.hpp @@ -7,7 +7,7 @@ #include "../fast_matrix_market.hpp" namespace fast_matrix_market { -#if __cplusplus >= 202002L +#if __cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) // If available, use C++20 concepts for programmer clarity. // This shows what fast_matrix_market expects each template type to support. @@ -201,7 +201,7 @@ namespace fast_matrix_market { write_body(os, formatter, options); } -#if __cplusplus < 202002L +#if __cplusplus < 202002L || (defined(_MSVC_LANG) && _MSVC_LANG < 202002L) // clean up after ourselves #undef triplet_read_vector #undef triplet_write_vector