I'm trying to get into meta-programming techniques, with the new C++11 we now get the ability to "forward" ( which is basically a cast for what I know ) the construction of the object so the lazy people are happier than ever and they don't have to write a lot of boiler plate stuff.
First of all is this a good implementation that reflects the factory pattern and perfect forwarding ?
Assuming that my code reflects what I think it reflects:
- the point of the factory pattern is to template the type that is passed to the constructor ?
- it's possible to avoid calling a constructor 2 times and improve my buildT ?
- what are other possible applications for std::forward ?
@JLBorges can you expand a little more ? I will read that, but I'm curious about what you guys think. The part with rvalues, the perfect forwarding is something that I'm still experimenting with, right now I'll stick with just the use of forward and the factory pattern for this question, at least for the moment.