Skip to content

Commit

Permalink
提交第八题
Browse files Browse the repository at this point in the history
  • Loading branch information
Lry722 committed Feb 8, 2024
1 parent 94296e5 commit 082b881
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/群友提交/第08题/Lry722.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <iostream>

template<class Ty,std::size_t size>
struct array {
Ty* begin() { return arr; };
Ty* end() { return arr + size; };
Ty arr[size];
};

template<typename ...Args>
array(Args &&... args) -> array<std::common_type_t<Args ...>, sizeof...(Args)>;

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

0 comments on commit 082b881

Please sign in to comment.