Closed
Description
Description
- Type: Bug
- Priority: Major
How to reproduce:
#include "mbed.h"
#include "rtos.h"
void donothing()
{
}
int main()
{
Callback<void()> func1;
Callback<void()> func2;
func1 = donothing;
func2 = donothing;
if (func1 != func2) {
error("Should be equal");
}
}
I had similar code in one patch that started failing. I was looking for API in Callback that would check if Callback was assigned the same function (the default one), the only way there I found was to use comparision operators. Those however fail, as shown above.
What I noticed that when those two objects are compared, _obj
is always different. Seems to me that generate()
method does not generate properly callback - does not pollute all members?