Re: Coding style question

2012-08-21 Thread Amos Jeffries
On 22.08.2012 03:48, Alex Rousskov wrote: On 08/21/2012 09:26 AM, Kinkie wrote: On Tue, Aug 21, 2012 at 4:47 PM, Alex Rousskov wrote: On 08/21/2012 12:19 AM, Kinkie wrote: .h file: #if OPTIONAL_FEATURE extern void someFunction(); #else // #define someFunction() // NOP // or: // static inline

Re: Coding style question

2012-08-21 Thread Alex Rousskov
On 08/21/2012 09:26 AM, Kinkie wrote: > On Tue, Aug 21, 2012 at 4:47 PM, Alex Rousskov > wrote: >> On 08/21/2012 12:19 AM, Kinkie wrote: .h file: > #if OPTIONAL_FEATURE > extern void someFunction(); > #else > // #define someFunction() // NOP > // or: > // static inline

Re: Coding style question

2012-08-21 Thread Kinkie
On Tue, Aug 21, 2012 at 4:47 PM, Alex Rousskov wrote: > On 08/21/2012 12:19 AM, Kinkie wrote: >>> .h file: >>> > #if OPTIONAL_FEATURE >>> > extern void someFunction(); >>> > #else >>> > // #define someFunction() // NOP >>> > // or: >>> > // static inline someFunction() {/* NOP */} >>> > >>> > #end

Re: Coding style question

2012-08-21 Thread Alex Rousskov
On 08/21/2012 12:19 AM, Kinkie wrote: >> .h file: >> > #if OPTIONAL_FEATURE >> > extern void someFunction(); >> > #else >> > // #define someFunction() // NOP >> > // or: >> > // static inline someFunction() {/* NOP */} >> > >> > #endif >> > >> > .cc file: >> > #if OPTIONAL_FEATURE >> > void someFun

Re: Coding style question

2012-08-21 Thread Amos Jeffries
On 21/08/2012 6:24 p.m., Kinkie wrote: If any, I'd go for static inline (or just inline, after all the namespace is already polluted). Is the cost of the extra function call worth the decreased readibility? To be clearer: I'm thinking about how this would interact e.g. with Doxygen documentation

Re: Coding style question

2012-08-20 Thread Kinkie
> If any, I'd go for static inline (or just inline, after all the > namespace is already polluted). > Is the cost of the extra function call worth the decreased readibility? To be clearer: I'm thinking about how this would interact e.g. with Doxygen documentation. -- /kinkie

Re: Coding style question

2012-08-20 Thread Kinkie
On Tue, Aug 21, 2012 at 7:36 AM, Amos Jeffries wrote: > On 21/08/2012 5:08 p.m., Kinkie wrote: >> >> Hi all, >>as I'm refactoring things around (currently hacking protos.h to >> pieces), I often encounter constructs such as: >> >> .h file: >> #if OPTIONAL_FEATURE >> extern void someFunction();

Re: Coding style question

2012-08-20 Thread Amos Jeffries
On 21/08/2012 5:08 p.m., Kinkie wrote: Hi all, as I'm refactoring things around (currently hacking protos.h to pieces), I often encounter constructs such as: .h file: #if OPTIONAL_FEATURE extern void someFunction(); #endif .cc file: #if OPTIONAL_FEATURE void someFunction() { //code } #end

Coding style question

2012-08-20 Thread Kinkie
Hi all, as I'm refactoring things around (currently hacking protos.h to pieces), I often encounter constructs such as: .h file: #if OPTIONAL_FEATURE extern void someFunction(); #endif .cc file: #if OPTIONAL_FEATURE void someFunction() { //code } #endif client code: #if OPTIONAL_FEATURE som