What is the correct way to forward all of the parent\'s constructors in C++0x?
I have been doing this:
class X: public Super {
template
I think you need to do Super(std::forward
if you want things forwarded properly. args
has a name, so I believe it will bind to regular references before rvalue references.
More importantly, though, you won't be forwarding copy constructors this way. The compiler will still generate one for you, because it doesn't consider template constructors. In the example provided, you're okay, because the compiler generated one will just call the parent copy constructor anyhow, which is exactly what you want. If that's not appropriate in a more complicated case, then you'll have to write it yourself.