使用关键字using在C ++中声明模板化函数指针的语法

时间:2014-02-28 09:39:12

标签: c++ templates function-pointers declaration

考虑

template<typename T>
struct auxiliary
{
  typedef std::unique_ptr<T> (*creator)(std::vector<double>const&);
};
template<typename T>
using creator = typename auxiliary<T>::creator;

我想知道如何在没有creator的情况下声明auxiliary,即

template<typename T>
using creator = ???    

1 个答案:

答案 0 :(得分:2)

template<typename T>
using creator = std::unique_ptr<T> (*)(std::vector<double> const&);