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 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/bit.hpp b/include/stdx/bit.hpp index 44e8d90..6fdf733 100644 --- a/include/stdx/bit.hpp +++ b/include/stdx/bit.hpp @@ -438,8 +438,7 @@ template using smallest_uint_t = decltype(smallest_uint()); namespace bit_detail { template -constexpr auto shifts = - []() -> std::array { +constexpr auto shifts = []()->std::array { constexpr auto offsets = std::array{std::size_t{}, Offsets...}; auto s = std::array{}; for (auto i = std::size_t{}; i < sizeof...(Offsets); ++i) { 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