diff --git a/include/rexy/compat/standard.hpp b/include/rexy/compat/standard.hpp index 9f994fe..28ecba5 100644 --- a/include/rexy/compat/standard.hpp +++ b/include/rexy/compat/standard.hpp @@ -19,6 +19,8 @@ #ifndef REXY_COMPAT_CPP20_HPP #define REXY_COMPAT_CPP20_HPP + #define REXY_REQUIRES_CPP20 static_assert(__cplusplus >= 202002L, "C++20 is required to use this file.") + #if __cplusplus >= 202002L #define REXY_CPP20_CONSTEXPR constexpr #define REXY_CPP20_CONSTEVAL consteval diff --git a/include/rexy/format.hpp b/include/rexy/format.hpp index a54deab..4eeb343 100644 --- a/include/rexy/format.hpp +++ b/include/rexy/format.hpp @@ -24,6 +24,8 @@ #include "compat/standard.hpp" +REXY_REQUIRES_CPP20; + #ifndef REXY_STANDARD_CPP20 //Maybe I'll make it work someday, but not for now #error "Cannot use formatting library without C++20 support" diff --git a/include/rexy/format.tpp b/include/rexy/format.tpp index f739fad..3033c81 100644 --- a/include/rexy/format.tpp +++ b/include/rexy/format.tpp @@ -19,6 +19,8 @@ #ifndef REXY_FORMAT_TPP #define REXY_FORMAT_TPP +REXY_REQUIRES_CPP20; + #include "detail/format/format_args.tpp" #include "detail/format/formatter.tpp" #include "detail/format/storage.tpp"