
On 12/18/2015 1:20 PM, Nat Goodspeed wrote:
Our code has any number of instances of this pattern:
template <typename T, typename U> class SomeTemplate { SomeTemplate(const T& t, const U& u); ... };
template <typename T, typename U> SomeTemplate<T, U> make_SomeTemplate(const T& t, const U& u) { return SomeTemplate<T, U>(t, u); }
Am I overlooking a generic boost::make<something>() of this general form?
template <template<typename...> class CLASS_TEMPLATE, typename... ARGS> CLASS_TEMPLATE<ARGS...> make(ARGS && ... args) { return CLASS_TEMPLATE<ARGS...>(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, -- Agustín K-ballo Bergé.- http://talesofcpp.fusionfenix.com