quote:Original post by random_acts
I''m pretty sure that all compilers must recognize the keyword(s), but they do not have to implement them. The standard says that the inline keyword is only a suggestion. The compiler is free to ignore you. Like MSVC does a "cost/benefit" analysis, if it''s worth it it inlines it, if not than it doesn''t.
That''s not what we''re talking about. I''m talking about this:
//In a header file, #included in two cpp filesclass B{ void b(){return 5}};
I have a very strong feeling that this is legal. Look at this answer, from comp.lang.c++.moderated.
quote:Original post by civguy
Inline is part of the standard that must be implemented in compilers.
I know that inline must be a valid keyword; I''m just saying that it''s not necessary to write it in the case of member functions. Hence, using the inline keyword is only mandatory when writing functions outside of a class definition in the header, but there is no good reason to do that, except for optimization, which is what I said.
quote:Inlining the function with ''inline''-keyword isn''t mandatory,I know.
quote:but the behaviour described by AP is.What behavior?
quote:Original post by PainlessWas it a class member function?
I can confirm that I''ve had code that wouldn''t link because of missing inline tags (compiler was MINGW32).
Cédric