I have a template \'Foo\', which owns a T, and I\'d like it to have a variadic constructor that forwards its arguments to T\'s constructor:
template
Disable the constructor when the argument type is the same type as or derived from this:
template
struct is_this_or_derived : public std::false_type {};
template
struct is_this_or_derived
: public std::is_base_of, std::decay_t >::type {};
template
using disable_for_this_and_derived
= std::enable_if_t::value>;
Use it as
template >
//^^^^
//this needs to be adjusted for each class
Foo(Args&&... args) : t(std::forward(args)...) {}