Suppose I have a very simple function that I expect the compiler to inline it. But I may need to throw exception on seeing some invalid input, would that stop the compiler from
I've just run into this situation with MSVC version 19. A function that throws an exception would not get inlined when compiling for x86. If I replace throw with exit(1) or if I compile for x86-64, it gets inlined just fine.