Call custom functions by jit in C++

Yes, I faced a similar example and as you mentioned it makes sense.