title: What does the "Expected '(' for function-style cast or type construction" error mean?
body: <p>I'm getting the error "Expected '(' for function-style cast or type construction", and have done my best to research the meaning of this error online, but have been unable to find any documentation of what causes this error.</p>
  
  <p>All the related questions on Stack Overflow that I have found bug fix a specific code snippet and do not explain more generally what is causing the error. </p>
  
  <p>These include</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/13675265/expected-for-function-style-cast-or-type-construction">Expected &#39;(&#39; for function-style cast or type construction</a> answer highlights several issues with the code. Which issue is actually causing the error is unclear.</li>
  <li><a href="https://stackoverflow.com/questions/26437103/c-xcode-expected-for-function-style-cast-or-type-construction">c++ Xcode expected &#39;(&#39; for function-style cast or type construction</a> defines functions inside a main function. This seems like a clear syntax problem, but why this specific error is produced is still unclear to me.</li>
  <li><a href="https://stackoverflow.com/questions/33747892/for-function-style-cast-or-construction-type-xcode-error">&#39;(&#39; for function-style cast or construction type Xcode error</a>. In this last example, the OP calls a function in a way that looks very similar to a function declaration, plus they declare a function with the same name but a different signature. Based on where the error is thrown and the message from the error, it seems that the error has something to do with function declarations.</li>
  </ol>
  
  <p><strong>Can I get a documentation-style answer that translates what "function-style cast" and "type construction" mean in simple english? When does the compiler choose to throw this error instead of some other error?</strong></p>
  
  <p>I don't want an answer that is specific to my own error, but as requested, here is my MCVE</p>
  
  <pre><code>#include &lt;boost/integer_traits.hpp&gt;
  
  class Test{
      const double MAX_DEPTH_VAL = (double) boost::integer_traits&lt;unsigned short&gt;.const_max;
      const double MIN_DEPTH_VAL = (double) boost::integer_traits&lt;unsigned short&gt;.const_max;
  
  };
  </code></pre>
  
  <p>I was led to believe that this syntax was possible, by this answer <a href="https://stackoverflow.com/a/2738576/3303546">https://stackoverflow.com/a/2738576/3303546</a> </p>