"Sahil Malik [MVP]" <co*****************@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Is there a way to do Inline methods in C# - like you can in C++?
If not, can anyone tell me the reasoning behind why they were removed?
You cannot specify them directly. The main reason is that they were never
guaranteed in C++ anyway. If you specify inline in C++, the compiler will
do it if it can. On the other hand, the C# compiler will do it whenever it
thinks it's best without you having to specify it. This results in
optimized code (which is the point of inline functions anyway), but without
the potential for slightly more control that you might have in C++. The end
result is usually going to be better, since the optimal solution will almost
always occur without any thought required on the programmers part.