Is there a way in C ++ to get a pointer to a built-in arithmetic operator? Something like this does not compile :
const auto addition = static_cast<int(*)(int, int)>(operator+);
A simple workaround for this problem is to create a helper lambda :
const auto addition = +[](const int a, const int b){ return a + b; };
But is there any other solution?
source share