diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00bb93e..b88376c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: matrix: os: - name: ubuntu - version: 24.04 + version: 26.04 - name: windows version: 2025-vs2026 build_type: @@ -62,13 +62,13 @@ jobs: compiler: - name: GCC toolset: gcc - version: 14 - executable: g++-14 + version: 15 + executable: g++-15 cxxflags: -fdiagnostics-color=always - name: Clang toolset: clang - version: 21 - executable: clang++-21 + version: 22 + executable: clang++-22 cxxflags: -stdlib=libc++ -fcolor-diagnostics - name: MSVC toolset: msvc diff --git a/README.md b/README.md index b42353d..5c3e1d4 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,9 @@ # iris Iris is a modern C++ library collection that provides a starting point for building various applications and libraries. + +### Supported Environments + +- C++23 and C++26 +- GCC 15 +- Clang 22 +- MSVC 2026 diff --git a/include/iris/colorize_format.hpp b/include/iris/colorize_format.hpp index 9f49540..93d458b 100644 --- a/include/iris/colorize_format.hpp +++ b/include/iris/colorize_format.hpp @@ -35,6 +35,13 @@ # define IRIS_COLORIZE_HAS_STATIC 0 #endif +// should be __cpp_lib_format >= 202603L +// TODO: since 202603L, `runtime_format` has been renamed to +// `dynamic_format`; our codebase needs renaming too. However +// we lack decent compilers right now; making it practically +// untestable. +#define IRIS_HAS_DYNAMIC_FORMAT 0 + namespace iris { class colorize_error : public std::invalid_argument @@ -905,7 +912,7 @@ struct basic_dynamic_colorized_string using dynamic_colorized_string = basic_dynamic_colorized_string; -#if __cpp_lib_format >= 202311L +#if IRIS_HAS_DYNAMIC_FORMAT template struct basic_dynamic_colorized_format_string @@ -956,8 +963,8 @@ struct basic_colorized_format_string scanner.scan(); } -#if __cpp_lib_format >= 202311L - explicit constexpr basic_colorize_format_string(detail::basic_dynamic_colorized_format_string dynamic_str) +#if IRIS_HAS_DYNAMIC_FORMAT + explicit constexpr basic_colorized_format_string(detail::basic_dynamic_colorized_format_string dynamic_str) : fmt_(std::runtime_format(dynamic_str.str_)) { } @@ -1018,13 +1025,13 @@ dynamic_colorize(std::string_view str) return detail::basic_dynamic_colorized_string{str}; } -#if __cpp_lib_format >= 202311L +#if IRIS_HAS_DYNAMIC_FORMAT template -[[nodiscard]] constexpr detail::dynamic_colorize_format_string +[[nodiscard]] constexpr detail::dynamic_colorized_format_string dynamic_colorize_format(std::string_view str) { - return detail::basic_dynamic_colorize_format_string{str}; + return detail::basic_dynamic_colorized_format_string{str}; } #endif @@ -1099,7 +1106,7 @@ constexpr Out colorize_format_to(Out out, static_colorized_string, Args&&.. template [[nodiscard]] constexpr std::string colorize_format(colorized_string_view str, Args&&... args) { -#if __cpp_lib_format >= 202311L +#if IRIS_HAS_DYNAMIC_FORMAT return std::format(std::runtime_format(ansi_colorize::colorize(str)), std::make_format_args(args...)); #else return std::vformat(ansi_colorize::colorize(str), std::make_format_args(args...)); @@ -1109,7 +1116,7 @@ template template [[nodiscard]] constexpr std::string colorize_format(colorize_config const& cfg, std::string_view str, Args&&... args) { -#if __cpp_lib_format >= 202311L +#if IRIS_HAS_DYNAMIC_FORMAT return std::format(std::runtime_format(ansi_colorize::colorize(colorized_string_view{str, &cfg}, &cfg)), std::make_format_args(args...)); #else return std::vformat(ansi_colorize::colorize(colorized_string_view{str, &cfg}, &cfg), std::make_format_args(args...)); @@ -1121,7 +1128,7 @@ template template Out, class... Args> constexpr Out colorize_format_to(Out out, colorized_string_view str, Args&&... args) { -#if __cpp_lib_format >= 202311L +#if IRIS_HAS_DYNAMIC_FORMAT return std::format_to(std::move(out), std::runtime_format(ansi_colorize::colorize(str)), args...); #else return std::vformat_to(std::move(out), ansi_colorize::colorize(str), std::make_format_args(args...)); @@ -1131,7 +1138,7 @@ constexpr Out colorize_format_to(Out out, colorized_string_view str, Args&&... a template Out, class... Args> constexpr Out colorize_format_to(Out out, colorize_config const& cfg, std::string_view str, Args&&... args) { -#if __cpp_lib_format >= 202311L +#if IRIS_HAS_DYNAMIC_FORMAT return std::format_to(std::move(out), std::runtime_format(ansi_colorize::colorize(colorized_string_view{str, &cfg}, &cfg)), args...); #else return std::vformat_to(std::move(out), ansi_colorize::colorize(colorized_string_view{str, &cfg}, &cfg), std::make_format_args(args...)); @@ -1166,7 +1173,7 @@ using ansi_colorize::static_colorized_string; using ansi_colorize::dynamic_colorize; -#if __cpp_lib_format >= 202311L +#if IRIS_HAS_DYNAMIC_FORMAT using ansi_colorize::dynamic_colorize_format; #endif diff --git a/include/iris/type_traits.hpp b/include/iris/type_traits.hpp index 1b768e2..7400713 100644 --- a/include/iris/type_traits.hpp +++ b/include/iris/type_traits.hpp @@ -57,7 +57,9 @@ struct at_c; template using at_c_t = at_c::type; -#if __cpp_pack_indexing >= 202311L // has native pack indexing +// Has native pack indexing? +// Note: GCC 15 emits "sorry, unimplemented: mangling type pack index" +#if !(defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 15) && __cpp_pack_indexing >= 202311L # define IRIS_CORE_PACK_INDEXING(I, Ts_ellipsis) Ts_ellipsis[I] diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index dcac8a3..4e2b3e7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -40,12 +40,13 @@ endif() set(CATCH_CONFIG_FAST_COMPILE ON) set(CATCH_CONFIG_NO_USE_BUILTIN_CONSTANT_P ON) set(CATCH_CONFIG_DISABLE_EXCEPTIONS ON) # disable default `catch(...)` to enable debugger +set(CATCH_CONFIG_COUNTER OFF) include(FetchContent) FetchContent_Declare( Catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2 - GIT_TAG v3.12.0 + GIT_TAG v3.15.3 GIT_SHALLOW ON ) FetchContent_MakeAvailable(Catch2) @@ -53,7 +54,11 @@ FetchContent_MakeAvailable(Catch2) set_target_properties(Catch2 PROPERTIES CXX_EXTENSIONS OFF) set_target_properties(Catch2 Catch2WithMain PROPERTIES FOLDER "_deps") -target_compile_definitions(Catch2 PUBLIC DO_NOT_USE_WMAIN) +target_compile_definitions( + Catch2 PUBLIC + DO_NOT_USE_WMAIN + CATCH_CONFIG_NO_COUNTER=1 +) if(MSVC) target_compile_options(Catch2 PRIVATE /wd6054)