Skip to content

The Functor in I2C implementation appears to not working as expected #112

@slavdors

Description

@slavdors

I may be misusing the feature, but I cannot make it working.
I am referring to the FUNCTOR template parameter in:
template<typename MANAGER, uint8_t REGISTER, typename T, typename FUNCTOR = functor::Identity> class TReadRegisterFuture
It appears only compiling when both FUNCTOR::ARG_TYPE and FUNCTOR::RES_TYPE types are related (when a cast is possible). I am not able to compile the code when both types are not related (and that's what I thought the functor was in the first place - to make this conversion possible).
Looking at the code in the ReadRegisterFuture template (i2c_device_utilities.h) I cannot see how it is possible for it to work.

Apologies for raising this if this is all OK and I simply missed something. Unfortunately, there is no example showing a case like mine - all existing ones convert types one-to-one.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions