KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Herb Sutter propose a simple implementation of make_unique() there: http://herbsutter.com/gotw/_102/ Here it is: template<typename T, typename ...Args> std::unique_ptr<T> make_unique( Args&& ...args ) { return std::unique_ptr<T>( new T( std::forward<Args>(args)... ) ); } My problem is that variadic templates are not yet part of VS2012, so I can't use this code as is. Is there a maintainable way to write this in VS2012 that wouldn't involve copy-pasting the same function with different args count?
Tags (comma-separated)
Save Edits
Cancel