Skip to content
Snippets Groups Projects
Commit 08abb38f authored by Julien Michel's avatar Julien Michel
Browse files

ENH: Add another New() implementation enabled for non default construcible...

ENH: Add another New() implementation enabled for non default construcible TFunctor so as to get a nice warning (thanks to @aregimbeau for the patch)
parent decf08db
No related branches found
No related tags found
No related merge requests found
......@@ -310,6 +310,17 @@ public:
p->UnRegister();
return p;
}
/** New() macro defined only if TFunction is NOT default constructible
* This will yield an error message since New() can not be implemented in this case. */
template <typename F = TFunction> static std::enable_if_t<!std::is_default_constructible<F>::value, Pointer> New()
{
static_assert(std::is_default_constructible<F>::value,"Cannot call New() "
"methode as the functor used for the filter creation is not default "
"constructible");
return nullptr;
}
/** Get the functor object.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment