Commit e292bc09 authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

test: add function-ref tests

parent 9ac9d152
......@@ -81,6 +81,21 @@ struct function_ref_class
}
};
struct function_ref_multiple_operator
{
int i;
void operator()(bool)
{
i = 1;
}
void operator()(double)
{
i++;
}
};
static void empty_fun(irt::model_id /*id*/) noexcept
{}
......@@ -466,6 +481,18 @@ main()
fr();
expect(i == 42);
}
{
function_ref_multiple_operator ops;
ops.i = 0;
irt::function_ref<void(bool)> b1(ops);
irt::function_ref<void(double)> b2(ops);
b1(true);
b2(0.0);
expect(ops.i == 2);
}
};
"time"_test = [] {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment