title: What's the difference between parentheses and braces in c++ when constructing objects
body: <p>What's the difference between <code>()</code> and <code>{}</code> when constructing objects? </p>
  
  <p>I think {} should only support with <code>initializer_list</code> or  an array, but when I run below snip, I confused.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  using namespace std;
  struct S {
      int v=0;
      S(int l) : v(l) {
      }
  };
  
  
  int main()
  {
      S s1(12); // statement1
      S s2{12}; // statement2
      cout &lt;&lt; s1.v &lt;&lt; endl;
      cout &lt;&lt; s2.v &lt;&lt; endl;
  }
  </code></pre>
  
  <p><code>statement1</code> is right because <code>()</code> is the basic grammar for constructing the object.</p>
  
  <p>I expect the <code>statement2</code> will be compiled failed. I think <code>{}</code> is only can be used for an array or <code>initializer_list</code> type. but the actual result is compiled perfectly without error. </p>
  
  <p>what do I mis? </p>