title: How to prevent default initialization of a const variable with a class type
body: <p>I have a custom class that I want to behave like a built-in type.</p>
  
  <p>However I have noticed that you can initialise a const variable of that class without providing an initial value. My class currently has an empty default constructor.</p>
  
  <p>Here is a comparison of int and my class foo:</p>
  
  <pre><code>int a;              // Valid
  int a = 1;          // Valid
  const int a = 1;    // Valid
  const int a;        // Error
  
  foo a;              // Valid
  foo a = 1;          // Valid
  const foo a = 1;    // Valid
  const foo a;        // Should cause an error, but it compiles
  </code></pre>
  
  <p>As you can see I need to prevent </p>
  
  <pre><code>const foo a;
  </code></pre>
  
  <p>from compiling.</p>
  
  <p>Any ideas from C++ gurus?</p>