Skip to content

Commit

Permalink
Merge pull request #305 from CSTGluigi/main
Browse files Browse the repository at this point in the history
mq松鼠提交16题
  • Loading branch information
Mq-b authored Feb 29, 2024
2 parents 876e54c + 5804bb6 commit 43a85fe
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/群友提交/第16题/mq松鼠.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include<iostream>
#include<cmath>
#define BY_NAME(func) [](auto&& ...args){ \
return func<std::common_type_t<decltype(args)...>>(std::forward<decltype(args)>(args)...); \
}
template<typename F, class...Args>
auto foo(F f, Args&&...args) {
return f(std::forward<Args>(args)...);
}

int main() {
const auto result = foo(BY_NAME(std::min), 2.8, 3);
std::cout << result << '\n';
}

0 comments on commit 43a85fe

Please sign in to comment.