diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2024-04-24 01:17:09 +0200 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2024-04-24 01:17:09 +0200 |
commit | 801e1f4793faa64b8de4c2b92a9c5dbcd818b969 (patch) | |
tree | 405423808b781a0071937828c7ec8d4013faa2eb /content/2024-04-24-fn-wrapper-macro-magic | |
parent | aa3f6e0a8109ab4cc759b23c9feccff9cee4e876 (diff) | |
download | blog-801e1f4793faa64b8de4c2b92a9c5dbcd818b969.tar.gz blog-801e1f4793faa64b8de4c2b92a9c5dbcd818b969.zip |
fn-wrapper: fix dates, add comment about gcc extenstion
Diffstat (limited to 'content/2024-04-24-fn-wrapper-macro-magic')
-rw-r--r-- | content/2024-04-24-fn-wrapper-macro-magic/index.md | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/content/2024-04-24-fn-wrapper-macro-magic/index.md b/content/2024-04-24-fn-wrapper-macro-magic/index.md index fe45614..b966a1a 100644 --- a/content/2024-04-24-fn-wrapper-macro-magic/index.md +++ b/content/2024-04-24-fn-wrapper-macro-magic/index.md @@ -51,7 +51,7 @@ chance to reason about what the code is doing. The draw back is that bodies have to be repeated for each wrapper. ```cpp -{{ include(path="content/2024-04-22-fn-wrapper-macro-magic/wrap-v1.cc") }} +{{ include(path="content/2024-04-24-fn-wrapper-macro-magic/wrap-v1.cc") }} ``` > In the code examples, I use the `MOCK_WRAPPER_IMPL`<sup><a href="#sup-1">1</a></sup> @@ -70,7 +70,7 @@ reason about the code. Additionally, the arguments must be specified twice, when defining a wrapper. ```cpp -{{ include(path="content/2024-04-22-fn-wrapper-macro-magic/wrap-v2.cc") }} +{{ include(path="content/2024-04-24-fn-wrapper-macro-magic/wrap-v2.cc") }} ``` ## Version 3 @@ -84,7 +84,7 @@ The example only supports function with **one** or **two** arguments, but the code can easily be extended. ```cpp -{{ include(path="content/2024-04-22-fn-wrapper-macro-magic/wrap-v3.cc") }} +{{ include(path="content/2024-04-24-fn-wrapper-macro-magic/wrap-v3.cc") }} ``` ## Version 4 @@ -98,8 +98,12 @@ variadic argument list [__VA_ARGS__][va-args] is presented in [__VA_NARG__][va-narg]. ```cpp, hide_lines=41-100 -{{ include(path="content/2024-04-22-fn-wrapper-macro-magic/wrap-v4.cc") }} +{{ include(path="content/2024-04-24-fn-wrapper-macro-magic/wrap-v4.cc") }} ``` +> The implementation to handle empty arguments **CPP_ARGC() == 0** uses a gcc +> extension for the **##** operator. This is also supported by clang, but not +> by msvc. Maybe I will come back in the future to update this, if I have the +> need. ## Appendix: Listify codegen data |