Skip to content

Commit

Permalink
Workaround MSVC's wrong __cplusplus value
Browse files Browse the repository at this point in the history
  • Loading branch information
alugowski committed Dec 28, 2023
1 parent 2895fc2 commit c5cb049
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/fast_matrix_market/app/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/fast_matrix_market/app/doublet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/fast_matrix_market/app/triplet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c5cb049

Please sign in to comment.