Is there a way to return an abstraction from a function without using new (for performance reasons) : <p>For example I have some function <code>pet_maker()</code> that creates and returns a <code>Cat</code> or a <code>Dog</code> as a base <code>Pet</code>. I want to call this function many many times, and do something with the <code>Pet</code> returned.</p>

<p>Traditionally I would <code>new</code> the <code>Cat</code> or <code>Dog</code> in <code>pet_maker()</code> and return a pointer to it, however the <code>new</code> call is much slower than doing everything on the stack.</p>

<p>Is there a neat way anyone can think of to return as an abstraction without having to do the new every time the function is called, or is there some other way that I can quickly create and return abstractions?</p>
