{"id":3474,"date":"2018-05-12T15:21:24","date_gmt":"2018-05-12T14:21:24","guid":{"rendered":"http:\/\/roboblog.fatal-fury.de\/?p=3474"},"modified":"2022-02-16T11:22:06","modified_gmt":"2022-02-16T10:22:06","slug":"c-guns-print-stdarray-with-stdinteger_sequence","status":"publish","type":"post","link":"http:\/\/roboblog.fatal-fury.de\/?p=3474","title":{"rendered":"C++ Guns: print std::array with std::integer_sequence"},"content":{"rendered":"<p><strong>Part1: print std::array with std:integer_sequence<\/strong><br \/>\n<a href=\"http:\/\/roboblog.fatal-fury.de\/?p=3508\">Part 2: convert tuple to parameter pack<\/a><br \/>\n<a href=\"http:\/\/roboblog.fatal-fury.de\/?p=3514\">Part 3: print std::array with std::apply and fold<\/a><br \/>\n<a href=\"http:\/\/roboblog.fatal-fury.de\/?p=3529\">Part 4: fold over std::tuple und erzeugten Assembler Code<\/a><br \/>\n<a href=\"http:\/\/roboblog.fatal-fury.de\/?p=3538\">Part 5: fold over std::tuple of std::vector of Types ...<\/a><br \/>\n<a href=\"http:\/\/roboblog.fatal-fury.de\/?p=3617\">Part 6: apply generic lambda to tuple<\/a><br \/>\n<a href=\"http:\/\/roboblog.fatal-fury.de\/?p=4994\">Part 7: Play with std::tuple and std::apply<\/a><\/p>\n<p>Wird an der Zeit, dass ich das auch mal versuche:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include &lt;array&gt;\r\n#include &lt;iostream&gt;\r\n\r\ntemplate&lt;size_t N, std::size_t... Ints&gt;\r\nvoid print_impl(const std::array&lt;double,N&gt;&amp; arr, std::index_sequence&lt;Ints...&gt;) {\r\n    ((std::cout &lt;&lt; std::get&lt;Ints&gt;(arr)),...);\r\n}\r\n\r\ntemplate&lt;size_t N&gt;\r\nvoid print(const std::array&lt;double,N&gt;&amp; arr) {\r\n    print_impl(arr, std::make_index_sequence&lt;N&gt;{});\r\n}\r\n\r\nvoid func() {\r\n    std::array&lt;double,4&gt; arr{1,2,3,4};\r\n    print(arr);\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Part1: print std::array with std:integer_sequence Part 2: convert tuple to parameter pack Part 3: print std::array with std::apply and fold Part 4: fold over std::tuple und erzeugten Assembler Code Part 5: fold over std::tuple of std::vector of Types ... Part 6: apply generic lambda to tuple Part 7: Play with std::tuple and std::apply Wird an [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[17],"class_list":["post-3474","post","type-post","status-publish","format-standard","hentry","category-allgemein","tag-cpp"],"_links":{"self":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/3474","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3474"}],"version-history":[{"count":4,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/3474\/revisions"}],"predecessor-version":[{"id":4996,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/3474\/revisions\/4996"}],"wp:attachment":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3474"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}