Only use forward declares when implementation hiding is a goal?
Closed this issue · 1 comments
jadamcrain commented
Use of forward declares seems to be non-productive in a number of places, e.g. IModbusManager. The forward-declared classes have to be included when compiling anyway in almost all situations, which then requires the user to manually include additional files which makes the library harder to use.
I suspect aggressive forward declarations are used ATM with the goal of reducing compile times? It may make more sense to use forward declares in non-public headers, but use includes in public headers to ease library usage.
Another possible way to mitigate this issue would be to have a global "Modbus.h" file that includes all required public headers.