In my efforts to port my C++ code to better (and more consistent) use of "Modern C++," my latest round of changes involves replacing typedef int32_t I2Arr[2]
aliasing to the more modern using I2Arr = int32_t[2]
style. This works fine for 'simple' (scalar) types, and is especially useful for defining function pointers:
using IFunc = int32_t(*)(int32_t, int32_t);
looks so much clearer (IMHO) than:
typedef int32_t(IFunc*)(int32_t, int32_t);
However, I've just become a bit stuck with replacing a typedef
for an actual function prototype (not a pointer-to-function). For example, I have the following code, using the 'old-style':
typedef int32_t MaskMaker(int32_t, const uint8_t *, uint8_t *);
static MaskMaker *maskMakers[maskNum];
Now, maybe (probably) I'm being really dim here, but I just can't figure out a way to convert this to the using
style of aliasing. Can anyone show me how to do this?
using MaskMaker = int32_t(int32_t, const uint8_t *, uint8_t *);
That's it, really.