Click here to Skip to main content
15,902,777 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: When to use "inline"? Pin
Christian Graus19-Aug-02 12:33
protectorChristian Graus19-Aug-02 12:33 
GeneralRe: When to use "inline"? Pin
User 665819-Aug-02 12:38
User 665819-Aug-02 12:38 
GeneralRe: When to use "inline"? Pin
Nick Hodapp19-Aug-02 13:12
sitebuilderNick Hodapp19-Aug-02 13:12 
GeneralRe: When to use "inline"? Pin
Christian Graus19-Aug-02 13:17
protectorChristian Graus19-Aug-02 13:17 
GeneralRe: When to use "inline"? Pin
Nick Hodapp19-Aug-02 13:27
sitebuilderNick Hodapp19-Aug-02 13:27 
GeneralRe: When to use "inline"? Pin
Christian Graus19-Aug-02 13:46
protectorChristian Graus19-Aug-02 13:46 
GeneralRe: When to use "inline"? Pin
Nick Hodapp19-Aug-02 14:06
sitebuilderNick Hodapp19-Aug-02 14:06 
GeneralRe: When to use "inline"? Pin
Daniel Lohmann19-Aug-02 23:42
Daniel Lohmann19-Aug-02 23:42 
GeneralRe: When to use "inline"? Pin
Mike Nordell12-Sep-02 6:40
Mike Nordell12-Sep-02 6:40 
GeneralRe: When to use "inline"? Pin
Stuart Dootson19-Aug-02 14:05
professionalStuart Dootson19-Aug-02 14:05 
GeneralRe: When to use "inline"? Pin
Nick Hodapp19-Aug-02 14:37
sitebuilderNick Hodapp19-Aug-02 14:37 
GeneralRe: When to use "inline"? Pin
Stuart Dootson19-Aug-02 15:07
professionalStuart Dootson19-Aug-02 15:07 
GeneralRe: When to use "inline"? Pin
Mustafa Demirhan19-Aug-02 14:03
Mustafa Demirhan19-Aug-02 14:03 
GeneralRe: When to use "inline"? Pin
Chris Maunder19-Aug-02 14:36
cofounderChris Maunder19-Aug-02 14:36 
GeneralRe: When to use "inline"? Pin
Mustafa Demirhan20-Aug-02 8:05
Mustafa Demirhan20-Aug-02 8:05 
GeneralRe: When to use "inline"? Pin
Chris Maunder20-Aug-02 17:03
cofounderChris Maunder20-Aug-02 17:03 
AnswerRe: When to use "inline"? Pin
Ed Gadziemski19-Aug-02 12:38
professionalEd Gadziemski19-Aug-02 12:38 
AnswerRe: When to use "inline"? Pin
Le centriste19-Aug-02 12:56
Le centriste19-Aug-02 12:56 
GeneralRe: When to use "inline"? Pin
Daniel Lohmann19-Aug-02 23:34
Daniel Lohmann19-Aug-02 23:34 
AnswerRe: When to use "inline"? Pin
Shog919-Aug-02 12:59
sitebuilderShog919-Aug-02 12:59 
To add to what the others have said, inline functions are also useful when you've got a class that's a minimal wrapper around some data (doesn't really do much with it but hold it together; this happens a lot when OOPing Win32 APIs...) and you want to be all nice and proper about it, so you make all data members private or protected. Instead of going to all the bother of writing out a separate CPP file with the access functions, since they're not going to be doing any validation or conversion anyway, just add them all to the header file as inline functions.

(oh yeah, no matter if you use the inline keyword or not, in order for the compiler to actually expand it, the function does have to be in the header file, or at least some file included where it's used.)

---

Shog9
Actually I use to find learning in bars when drinking really useful.
It sort of makes a language liquid.
- Colin Davies, Thinking in English?

AnswerRe: When to use "inline"? Pin
Michael Dunn19-Aug-02 17:09
sitebuilderMichael Dunn19-Aug-02 17:09 
GeneralInitialization order of globals Pin
Todd Smith19-Aug-02 11:15
Todd Smith19-Aug-02 11:15 
GeneralRe: Initialization order of globals Pin
Tomasz Sowinski19-Aug-02 11:23
Tomasz Sowinski19-Aug-02 11:23 
GeneralRe: Initialization order of globals Pin
Wes Jones19-Aug-02 11:23
Wes Jones19-Aug-02 11:23 
GeneralRe: Initialization order of globals Pin
Daniel Lohmann19-Aug-02 23:46
Daniel Lohmann19-Aug-02 23:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.