Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static constexpr MyStruct ops[6] = {
- {'+', [&] (double a, double b) { return a+b; } },
- {'-', [&] (double a, double b) { return a-b; } },
- ...
- };
- typedef double (*binOp)(double, double);
- struct MyStruct {
- char c;
- binOp fn;
- };
- std::function <double(double,double)> fn;
- static const MyStruct ops[6] = {
- {'+', [] (double a, double b) { return a+b; } },
- {'-', [] (double a, double b) { return a-b; } },
- };
Add Comment
Please, Sign In to add comment