Topic: Using Initializer lists to initialize references to arrays (C++0x)


Author: Faisal Vali <faisalv@gmail.com>
Date: Sun, 11 Oct 2009 17:02:38 CST
Raw View
Can anyone tell me if any of  the following are intended to be well-
formed based on the latest draft of C++0x (n2960.pdf):

int (&arr)[3] = { 1, 2, 3 };
const int (&arr)[3] = {1,2,3};
int (&&arr)[3] = {1,2,3};

int (&arr)[] = { 1, 2, 3 };
const int (&arr)[] = {1,2,3};
int (&&arr)[] = {1,2,3};


template<class T, int N> void f(T (&arr)[N]);  // NOT - f
(initializer_list<T>)

f({1,2,3}); // does this work? and what are T and N deduced to?

thanks,
Faisal Vali
Radiation Oncology
Loyola


--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]