Is this code legal?

Paolo Bonzini bonzini@gnu.org
Tue Oct 6 10:05:00 GMT 2009


On 10/05/2009 09:29 PM, Sergey Sadovnikov wrote:
> Can anybody explain why line marked with '{*1}' produce this error
> message:

I think it's because there is no constructor for array that takes an 
initializer_list.  I get this message if I change your {*2} line to:

std::array < wchar_t, sizeof...(Chars) > msg({Chars...}); // {*2}

f.cc:12: error: no matching function for call to
  ‘std::array<wchar_t, 30ul>::array(<brace-enclosed initializer list>)’
tr1_impl/array:50: note: candidates are:
  std::array<wchar_t, 30ul>::array(const std::array<wchar_t, 30ul>&)
tr1_impl/array:50: note:
  std::array<wchar_t, 30ul>::array()

In general, this kind of question is best asked on a C++ forum.

Paolo



More information about the Gcc mailing list