From 462b47bd4327540c004ef0944f17da4f1b2fef0b Mon Sep 17 00:00:00 2001 From: Gammasoft Date: Mon, 16 Oct 2023 14:18:17 +0200 Subject: [PATCH] Add cpp26 --- src/xtd.core/include/xtd/language_id.h | 2 ++ src/xtd.core/src/xtd/cpp_language.cpp | 18 +++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/xtd.core/include/xtd/language_id.h b/src/xtd.core/include/xtd/language_id.h index a4bad66126f4..168a268d9570 100644 --- a/src/xtd.core/include/xtd/language_id.h +++ b/src/xtd.core/include/xtd/language_id.h @@ -31,6 +31,8 @@ namespace xtd { cpp20, /// @brief The language is c++23. cpp23, + /// @brief The language is c++26. + cpp26, }; } diff --git a/src/xtd.core/src/xtd/cpp_language.cpp b/src/xtd.core/src/xtd/cpp_language.cpp index be82b97c3cf6..b8ec8e5e03aa 100644 --- a/src/xtd.core/src/xtd/cpp_language.cpp +++ b/src/xtd.core/src/xtd/cpp_language.cpp @@ -14,8 +14,8 @@ bool cpp_language::is_supported() const noexcept { } language_id cpp_language::language() const noexcept { - /// @todo Remove comment when c++23 is defined... - //if (cpp_ >= ??????L) return language_id::cpp23; //TBD + if (cpp_ >= 202601L) return language_id::cpp26; /// @todo Set the correct value when the __cplusplus macro is defined for c++26... + if (cpp_ >= 202301L) return language_id::cpp23; /// @todo Set the correct value when the __cplusplus macro is defined for c++23... if (cpp_ >= 202002L) return language_id::cpp20; if (cpp_ >= 201703L) return language_id::cpp17; if (cpp_ >= 201402L) return language_id::cpp14; @@ -26,13 +26,13 @@ language_id cpp_language::language() const noexcept { } language_id cpp_language::experimental_language() const noexcept { - /// @todo Remove comment when c++23 is defined... - //if (cpp_ >= ??????L) return language_id::cpp23; - if (cpp_ >= 201707L) return language_id::cpp20; - if (cpp_ >= 201411L) return language_id::cpp17; - if (cpp_ >= 201210L) return language_id::cpp14; - if (cpp_ >= 200410L) return language_id::cpp11; - if (cpp_ >= 199711L) return language_id::cpp98; + if (cpp_ >= 202302L) return language_id::cpp26; /// @todo Set the correct value when the __cplusplus macro is defined for c++23... + if (cpp_ >= 202003L) return language_id::cpp23; + if (cpp_ >= 201704L) return language_id::cpp20; + if (cpp_ >= 201403L) return language_id::cpp17; + if (cpp_ >= 201104L) return language_id::cpp14; + if (cpp_ >= 199712L) return language_id::cpp11; + if (cpp_ >= 2L) return language_id::cpp98; if (cpp_ >= 1L) return language_id::cpp_pre98; return language_id::unknown; }