I know, the question of passing scalars by value vs. by reference has been asked and answered gazillion times before, and I know - in general - they should be passed by value. But what about inline functions? And the reason I ask this is I just did some refactoring with Visual Studio 2022, and when I called VS's "Extract Function" command, it extracted the scalar variables like constant reference (e.g. const int &).
Does VS know something I don't in relation to inline functions, or should I double check and override the code generated by VS?
Edit #1: I also noticed, when pointers were passed as parameters, it didn't use the inline keyword. Is it because it knows these functions cannot be inlined? If yes, why?
Edit #2: It also did some other funny things. For example: (Vehicle *& vehicle_ptr) It just referenced a pointer. I think it proves that VS does the function extraction using some very simple script.
inline, there is no guarantee that the function will be inlined, so pass the parameters as you would normally.inlinemakes no difference on wether you should pass by value or pass by reference. You can use the information you found in gazillion other places. I suggest isocpp.github.io/CppCoreGuidelines/… because it is rather exhaustive. Note that it does not mentioninlinebecause it makes no difference