EnableIf And PerfectForwarding With Templated Constructors - GerdHirsch/Cpp-TemplateBasics GitHub Wiki

This Project demonstrates the usage of templated constructors, std::enabel_if<..> and perfect forwarding with std::forward<..>.

class Base has two Member m1 and m2 and a templatized constructor which has two forwarding reference parameters of Member&&. The third parameter is a dummy parameter to enable SFINAE with enableForMembersOnly based on std::enable_if to which it delegates via inheritance.

There is a talk about this stuff from Nicolai Josuttis at cppcon 2017.