#include #include class Point { public: Point(){} Point(int y) :y(y){} Point(int x, int y): x(x), y(y){} friend std::ostream& operator <<(std::ostream& os, Point& p) { return os << "(" << p.x << "," << p.y << ")"; } private: int x= 0; int y= 0; }; template std::unique_ptr make_unique(Args&&... args){ return std::unique_ptr(new T(std::forward(args)...)); } int main(){ std::cout << std::endl; auto myInt= make_unique(2011); std::cout << "*myInt: " << *myInt << std::endl; std::cout << std::endl; std::cout << "*make_unique(): " << *make_unique() << std::endl; std::cout << "*make_unique(2011): " << *make_unique(2011) << std::endl; std::cout << "*make_unique (2011,2014): " << *make_unique (2011,2014) << std::endl; std::cout << std::endl; }