Re:Cdecl: C Gibberish ↔ English
by jbandela1 on Saturday April 23, 2022 @11:30AM
(#31135103)
If you are using C++, you can make this a lot easier using this template alias
Basically this simple trick removes most of the confusion, and you can read the types left to right.
[ Parent
| on HN ]
It also makes function pointer types much clearer:
using func_ptr = float(int);
// Given
float some_func(int);
// Then
func_ptr* a = &some_func;
// Also
func_ptr* b = [] (int x) { return 0.f; };