How to disallow temporaries
<p>For a class Foo, is there a way to disallow constructing it without giving it a name?</p>

<p>For example:</p>

<pre><code>Foo("hi");
</code></pre>

<p>And only allow it if you give it a name, like the following?</p>

<pre><code>Foo my_foo("hi");
</code></pre>

<p>The lifetime of the first one is just the statement, and the second one is the enclosing block.  In my use case, <code>Foo</code> is measuring the time between constructor and destructor. Since I never refer to the local variable, I often forget to put it in, and accidentally change the lifetime.  I'd like to get a compile time error instead.</p>
