Macro to check for c++20 support instead of long form writing
This commit is contained in:
parent
7f47a4cbf8
commit
fb19bdec67
@ -19,6 +19,8 @@
|
|||||||
#ifndef REXY_COMPAT_CPP20_HPP
|
#ifndef REXY_COMPAT_CPP20_HPP
|
||||||
#define 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
|
#if __cplusplus >= 202002L
|
||||||
#define REXY_CPP20_CONSTEXPR constexpr
|
#define REXY_CPP20_CONSTEXPR constexpr
|
||||||
#define REXY_CPP20_CONSTEVAL consteval
|
#define REXY_CPP20_CONSTEVAL consteval
|
||||||
|
|||||||
@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
#include "compat/standard.hpp"
|
#include "compat/standard.hpp"
|
||||||
|
|
||||||
|
REXY_REQUIRES_CPP20;
|
||||||
|
|
||||||
#ifndef REXY_STANDARD_CPP20
|
#ifndef REXY_STANDARD_CPP20
|
||||||
//Maybe I'll make it work someday, but not for now
|
//Maybe I'll make it work someday, but not for now
|
||||||
#error "Cannot use formatting library without C++20 support"
|
#error "Cannot use formatting library without C++20 support"
|
||||||
|
|||||||
@ -19,6 +19,8 @@
|
|||||||
#ifndef REXY_FORMAT_TPP
|
#ifndef REXY_FORMAT_TPP
|
||||||
#define REXY_FORMAT_TPP
|
#define REXY_FORMAT_TPP
|
||||||
|
|
||||||
|
REXY_REQUIRES_CPP20;
|
||||||
|
|
||||||
#include "detail/format/format_args.tpp"
|
#include "detail/format/format_args.tpp"
|
||||||
#include "detail/format/formatter.tpp"
|
#include "detail/format/formatter.tpp"
|
||||||
#include "detail/format/storage.tpp"
|
#include "detail/format/storage.tpp"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user