mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
29 lines
682 B
C++
29 lines
682 B
C++
#include <cstddef>
|
|
|
|
extern int regression_1000();
|
|
extern int regression_1008();
|
|
extern int regression_1067();
|
|
extern int regression_1072();
|
|
extern int regression_1087();
|
|
|
|
using f_ptr = int();
|
|
|
|
int trampoline(f_ptr* f) {
|
|
try {
|
|
return f();
|
|
}
|
|
catch (...) {
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
int main(int, char*[]) {
|
|
f_ptr* regressions[] = { ®ression_1008, ®ression_1000, ®ression_1067, ®ression_1072, ®ression_1087 };
|
|
const int sizeof_regressions = sizeof(regressions) / sizeof(regressions[0]);
|
|
int r = 0;
|
|
for (std::size_t i = 0; i < sizeof_regressions; ++i) {
|
|
f_ptr* f = regressions[i];
|
|
r += static_cast<int>(trampoline(f) != 0);
|
|
}
|
|
return r;
|
|
} |