make_auto implementation for C++03 compilers I want to provide, in the the spirit of C++11/boost make_shared and C++14 make_unique, a production-ready make_auto for C++03 compilers.

So, inspired boost's make_shared implementation for C++03 compilers, I provide N overloads (0 to 10, currently) of the same make_auto function.

template &lt;typename T&gt;
inline std::auto_ptr&lt;T&gt; make_auto()
{
   return std::auto_ptr&lt;T&gt;(new T()) ;
}

template &lt;typename T, typename T_0&gt;
inline std::auto_ptr&lt;T&gt; make_auto(const T_0 &amp; p_0)
{
   return std::auto_ptr&lt;T&gt;(new T(p_0)) ;
}

template &lt;typename T, typename T_0, typename T_1&gt;
inline std::auto_ptr&lt;T&gt; make_auto(const T_0 &amp; p_0, const T_1 &amp; p_1)
{
   return std::auto_ptr&lt;T&gt;(new T(p_0, p_1)) ;
}

// etc.


Is there something wrong with this code?

Implementation details:


the const reference is inspired by boost's shared_ptr. After trying multiple alternatives (including GManNickG's excellent answer here), I had to gave up because of some challenged compilers. To pass non-const references, I'll use boost::ref.
the inline keyword is mandatory for reasons that have nothing to do with the problem.


Background info:

I need this for multiple reasons, among them:


I am stuck with C++03 compilers (and I suspect some of them of not even being that... I'm looking at you, SunStudio). This means even C++03 emulations of unique_ptr don't work (we tried)
avoiding writing new/delete in my C++ code (see Stroustrup's C++11 style video)
offering my coworkers the means to use a more modern C++ coding style despite aforementioned compilers limitations (RAII, that is)
more exception safety
I need a lightweight smart pointer with unique-ownership semantics, able to transfer ownership, so boost::shared_ptr and boost::scoped_ptr are not an option
Disclaimer: this is not an attempt to answer your technical question, but suggesting alternatives to reach some compromise of your stated goals. It wouldn't fit in a comment :-)

I am not sure it is a good idea to actually write a make_auto. It is akin to rearranging the deck chairs on the Titanic. After it hit the iceberg.

You'd be better off with emulating a std::unique_ptr using C++98/03 features. Howard Hinnant has one version on his website. You might even get lucky and get its macro variadic version to work nicely with the std::make_unique proposal by Stephan T. Lavavej.

I'd take that as the preferred option, with using boost::shared_ptr or boost_scoped_ptr as the preferred alternative option. If you insist on keeping std::auto_ptr, make its use as painful as possible. Without pain, you'll find it more difficult to convince your colleagues to upgrade to C++11.

Please also make sure to introduce your team to the other language emulation features that Boost provides (Foreach, Move).