Description
Description
We have a consistent handling of the way we translate from the C-layer void*
to the C++ objects in each of the C layer API methods, so it should be possible to unify this handling and hide it inside the template, further reducing the LOC in the interface
Justification
More standardization improves maintenance
Implementation Strategy
The arguments to the template's lambda function capture might be able to include a reinterpret_cast of the void*
object passed in from C. This would requires consistent naming and for the name in the capture to not be evaluated until the capture is performed (which may be inconsistent with C++ specs, in which case this won't work at all). If it does work, it's a relatively simple way to eliminate another hundred lines or so of code from the C interface layer.