From 9a4f0a92d987c29dd33364260dd0231847c0a8cc Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Thu, 2 Oct 2025 14:09:52 -0600 Subject: [PATCH 1/3] :arrow_up: Update mermaid Problem: - Mermaid is updated upstream. Solution: - Apply the update here. --- .github/workflows/asciidoctor-ghpages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/asciidoctor-ghpages.yml b/.github/workflows/asciidoctor-ghpages.yml index 9f347fe..45cc5a2 100644 --- a/.github/workflows/asciidoctor-ghpages.yml +++ b/.github/workflows/asciidoctor-ghpages.yml @@ -42,7 +42,7 @@ jobs: - name: Install Mermaid run: | - npm install -g @mermaid-js/mermaid-cli@11.4.2 + npm install -g @mermaid-js/mermaid-cli@11.12.0 npx puppeteer browsers install chrome-headless-shell - name: Install asciidoctor From d1c55e3c03e83ce13576eeb42cd53f50f0d772fc Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Thu, 2 Oct 2025 14:11:12 -0600 Subject: [PATCH 2/3] :art: Make `function_traits` available in freestanding Problem: - `function_traits` uses `std::function` which is not available in freestanding implementations. Solution: - Rewrite `function_traits` to avoid relying on `std::function`. Note: - We do not deal with `noexcept`-qualified functions here. --- .gitignore | 2 +- docs/for_each_n_args.adoc | 2 - docs/function_traits.adoc | 2 - include/stdx/function_traits.hpp | 130 ++++++++++++++++++++--- test/function_traits.cpp | 177 +++++++++++++++++++++++++++++++ usage_test/main.cpp | 2 - 6 files changed, 291 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 6152536..a9aa622 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ build/ /venv /.vscode /.idea -/.cache +.cache/ /.DS_Store .clang-format .clang-tidy diff --git a/docs/for_each_n_args.adoc b/docs/for_each_n_args.adoc index e532e76..b875c65 100644 --- a/docs/for_each_n_args.adoc +++ b/docs/for_each_n_args.adoc @@ -5,8 +5,6 @@ https://github.com/intel/cpp-std-extensions/blob/main/include/stdx/for_each_n_ar provides a method for calling a function (or other callable) with batches of arguments from a parameter pack. -IMPORTANT: `for_each_n_args` is not yet available on freestanding implementations. - Examples: [source,cpp] ---- diff --git a/docs/function_traits.adoc b/docs/function_traits.adoc index d95cefa..0a1b97a 100644 --- a/docs/function_traits.adoc +++ b/docs/function_traits.adoc @@ -5,8 +5,6 @@ https://github.com/intel/cpp-std-extensions/blob/main/include/stdx/function_trai contains type traits for introspecting function signatures. It works with functions, lambda expressions, and classes with `operator()`. -IMPORTANT: Function traits are not yet available on freestanding implementations. - Examples: [source,cpp] ---- diff --git a/include/stdx/function_traits.hpp b/include/stdx/function_traits.hpp index ae2cb9e..9fc2e2e 100644 --- a/include/stdx/function_traits.hpp +++ b/include/stdx/function_traits.hpp @@ -5,32 +5,136 @@ #include #include -#include #include #include namespace stdx { inline namespace v1 { namespace detail { -template struct function_traits; +template struct any_type { + // NOLINTNEXTLINE(google-explicit-constructor) + template operator T(); +}; -template -struct function_traits> { +template struct function_traits; + +template struct function_traits { using return_type = R; template