Error is " functions containing switch are not expanded inline
when i was writing a program in cpp compiler i have got error that " functions containing switch are not expanded inline" what does it mean?
please tell me.
An inline function happens when you declare a function inline or include the function definition inside the body of a class or struct. What an inline function means is that you are telling the compiler to insert the complete body of the function in every place in the code where that function is used. Inline function are used to reduce the time overhead when a function is called specifically the stack pushes and pops. Now just because you declare something to be inline doesn't mean the compilier has to listen to you.
Basically what your error is telling you is that a function with a switch statement is to compilicated to be inlined. To fix your error move your function definition outside of the class declaration or remove the inline keyword.
Comment