Le 18/12/2015 17:44, Agustín K-ballo Bergé a écrit :
On 12/18/2015 1:20 PM, Nat Goodspeed wrote:
Our code has any number of instances of this pattern:
template
class SomeTemplate { SomeTemplate(const T& t, const U& u); ... }; template
SomeTemplate make_SomeTemplate(const T& t, const U& u) { return SomeTemplate (t, u); } Am I overlooking a generic boost::make<something>() of this general form?
template class CLASS_TEMPLATE, typename... ARGS> CLASS_TEMPLATE
make(ARGS && ... args) { return CLASS_TEMPLATE (std::forward<ARGS>(args)...); } If that doesn't already exist... would it be useful to add (a less naive version) somewhere?
This might be relevant: https://github.com/viboes/std-make
Regards, Yes, I'm working on a generic make factory
There is a draft proposal not yet finished at https://github.com/viboes/std-make/blob/master/doc/proposal/factories/DXXXX_... Best, Vicente