Skip to content

Commit

Permalink
第八题
Browse files Browse the repository at this point in the history
  • Loading branch information
MiFeng-super committed Aug 14, 2023
1 parent 247e4a7 commit 2670f01
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/群友提交/第八题/mifeng.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <iostream>

template<class Ty, size_t size>
struct array
{
Ty *begin() { return arr; };

Ty *end() { return arr + size; };
Ty arr[size];
};

template<class T, class... Args>
array(T arg, Args... args) -> array<T, sizeof...(Args) + 1>;

int main()
{
::array arr{1, 2, 3, 4, 5};
for (const auto &i: arr)
{
std::cout << i << ' ';
}
}

0 comments on commit 2670f01

Please sign in to comment.