-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Hi,
related to #19 (and thus using code from branch develop) ... I'm just meddling with a similar library (ref),
and came across an issue, that affects StaticFunction
as well:
// ...
#include <iostream>
struct Func {
void operator()() const {
std::cout << "const ";
}
void operator()() {
std::cout << "nonconst";
}
};
int main()
{
{
Func func{};
embxx::util::StaticFunction<void(), 32> f(func);
f();
std::cout << "\t should get ";
func();
std::cout << std::endl;
}
{
const Func func{};
embxx::util::StaticFunction<void(), 32> f(func);
f();
std::cout << "\t should get ";
func();
std::cout << std::endl;
}
}
This prints
nonconst should get nonconst
nonconst should get const
So with the mutable
(ref)... the void operator()() const
is not called in the end...
Metadata
Metadata
Assignees
Labels
No labels