title: static_assert on initializer_list::size()
body: <p>Why is <code>std::initializer_list&lt;_E&gt;::size</code> not allowable in a <code>static_assert</code>, even though it's declared as a <code>constexpr</code> in my libstdc++ (v. 4.6)?</p>
  <p>For example, the following code:</p>
  <pre><code>template&lt;class T, int Length&gt;
  class Point
  {
    public:
      Point(std::initializer_list&lt;T&gt; init)
      {
        static_assert(init.size() == Length, &quot;Wrong number of dimensions&quot;);
      }
  };
  
  int main()
  {
    Point&lt;int, 3&gt; q({1,2,3});
  
    return 0;
  }
  </code></pre>
  <p>gives the following error:</p>
  <pre><code>test.C: In constructor ‘Point&lt;T, Length&gt;::Point(std::initializer_list&lt;_Tp&gt;) [with T = int, int Length = 3]’:
  test.C:60:26:   instantiated from here
  test.C:54:7: error: non-constant condition for static assertion
  test.C:54:73:   in constexpr expansion of ‘init.std::initializer_list&lt;_E&gt;::size [with _E = int, std::initializer_list&lt;_E&gt;::size_type = long unsigned int]()’
  test.C:54:7: error: ‘init’ is not a constant expression
  </code></pre>
  <p>Note that this works just fine for a trivial example:</p>
  <pre><code>class A
  {
    public:
      constexpr int size() { return 5; }
  };
  
  int main()
  {
    A a;
    static_assert(a.size() == 4, &quot;oh no!&quot;);
  
    return 0;
  }
  </code></pre>