Invalid initialization of non-const reference to type from a temporary of type
<p>My class structure is as follows:</p>

<p>Test_Camera.h:</p>

<pre><code>class Test_Camera : public Camera_Interface {
public:
   Test_Camera (string const&amp; aName);
   ...
</code></pre>

<p>Test_Camera.cpp</p>

<pre><code>Test_Camera::Test_Camera(string const&amp; aName) : Camera_Interface(0, 0, 0, 0), name(aName)
</code></pre>

<p>In my code that instantiates a <code>Test_Camera</code> object I have 2 scenarios. The first compiles fine, but the second doesn't and I can't figure out why.</p>

<pre><code>Test_Camera cam ("cam"); // This compiles

Test_Camera&amp; cam ("cam"); // This does not compile
</code></pre>

<p>When I try to compile the second example I get an error:</p>

<blockquote>
  <p>error: invalid initialization of non-const reference to type 'Test_Camera&amp;' from a temporary of type 'const char*'</p>
</blockquote>

<p>I also tried:</p>

<pre><code>string name = "cam";
Test_Camera&amp; cam (name); //does not compile
</code></pre>
