Commit 08abb38f authored by Julien Michel's avatar Julien Michel

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
......@@ -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 "
  • A little pedantic remark: It should be function instead of the French methode -- according to TC++PL, a method is a virtual member function. Odd choice, isn't it?

    Edited by Luc Hermitte
  • Done.

Please register or sign in to reply
"constructible");
return nullptr;
}
/** Get the functor object.
*
......
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