@aras @dotstdy @molecularmusing Member functions defined in a class definition are implicitly inline (in the sense of the inline keyword) by the C++ standard so I think it makes sense. Granted, there could be a __forceinline vs inline distinction but I'd say that's a failing of the language conflating two concepts a bit.
If I may ask, what's the reason _not_ wanting inlining (in the optimization sense) for functions like that? I'm thinking it often correlates quite well.
#ifdef _MSC_VER #define INLINE __forceinline #define NOINLINE __declspec(noinline) #else #define INLINE __attribute__((always_inline)) #define NOINLINE __attribute__((noinline)) #endif static inline INLINE float add(float x, float y) { return x + y; } NOINLINE float accumulate(float *values, size_t num_values) { float acc = 0.0f; for (size_t i = 0; i < num_values; i++) { acc = add(acc, values[i]); } return acc; }