Saturday, January 23, 2021

Digest for comp.lang.c++@googlegroups.com - 20 updates in 5 topics

Bonita Montero <Bonita.Montero@gmail.com>: Jan 23 06:46AM +0100


>> They aren't recommended, i.e. they should be replaced by inline-code
>> as most as possible. Macros tend to be cryptic and can't be debugged.
 
> Agreed.
 
There are only three reaons for macros:
* pseudo-functions that are ina header and inlined and need to be
compatible with C and C++.
* psduo-constant which can be overriden, which is impossible with
a const or constexpr-"variable":
#if !defined(LRU_FETCH_DELAY_BUFFERS)
#define LRU_DELAY_BUFFERS 200

No comments: