From 082b881d4b16991239bccebb2ebb3c1419c90ee0 Mon Sep 17 00:00:00 2001 From: Lry722 <958515687@qq.com> Date: Thu, 8 Feb 2024 21:57:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=AC=AC=E5=85=AB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\347\254\25408\351\242\230/Lry722.cpp" | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 "src/\347\276\244\345\217\213\346\217\220\344\272\244/\347\254\25408\351\242\230/Lry722.cpp" diff --git "a/src/\347\276\244\345\217\213\346\217\220\344\272\244/\347\254\25408\351\242\230/Lry722.cpp" "b/src/\347\276\244\345\217\213\346\217\220\344\272\244/\347\254\25408\351\242\230/Lry722.cpp" new file mode 100644 index 00000000..f7f55a0b --- /dev/null +++ "b/src/\347\276\244\345\217\213\346\217\220\344\272\244/\347\254\25408\351\242\230/Lry722.cpp" @@ -0,0 +1,18 @@ +#include + +template +struct array { + Ty* begin() { return arr; }; + Ty* end() { return arr + size; }; + Ty arr[size]; +}; + +template +array(Args &&... args) -> array, sizeof...(Args)>; + +int main() { + ::array arr{1, 2, 3, 4, 5}; + for (const auto& i : arr) { + std::cout << i << ' '; + } +}