Inline function definitions in .C files

Taligent previously advocated putting some inline function definitions in .C files, so that only internal functions would get the inline version (normal clients would call it out-of-line). However, avoid this because it is not a portable construct.

An equivalent portable alternative is to have a private inline defined in the header file. Internal clients can call the private inline, and you can provide a public (out-of-line) function for normal clients to call that turns around and calls the inline.

NOTE As with all inlines, of course, if the function is more than a few lines you should not make it inline.

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker