How to inline member functions?
Hi
First off, I am using Visual Studio .NET.
I am trying to inline member functions of a class. When I add the inline keyword to either the prototype in the class definition or the function itself, the program compiles, but the linker complains that the function is missing, and lists the place where the function is being called from.
Particles error LNK2019: unresolved external symbol "public: void __thiscall CParticleEngine::AddParticle(unsigned long,class CParticle *)" (?AddParticle@CParticleEngine@@QAEXKPAVCParticle@@@Z) referenced in function "public: bool __thiscall CParticleEmitter::Update(float)" (?Update@CParticleEmitter@@QAE_NM@Z)
Can anyone help me?
Thanks
Inline member functions must be either inline, or be defined in the header file.
Update GameDev.net system time campaign:
[edited by - dalleboy on January 20, 2003 5:03:49 AM]
class foo{ void bar() { // do some stuff... } void baz();};inline void foo::baz(){ // do some other stuff...}
Update GameDev.net system time campaign:
'date ddmmHHMMYYYY'
[edited by - dalleboy on January 20, 2003 5:03:49 AM]
Putting member functions in the class declaration (bar in dalleboy''s example) guarantees inlining. Using the inline keyword (baz) does not guarantee inlining.
quote:Original post by Anonymous Poster
Putting member functions in the class declaration (bar in dalleboy''s example) guarantees inlining. Using the inline keyword (baz) does not guarantee inlining.
got a source to back this up?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement