This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

tr1::array initialization


I've searched this list as well as google and the c++ committee
information I've found on gcc.gnu.org and haven't seen any discussion
about this nice-to-have initialization of tr1::array:

tr1::array<int> a = { 1, 4, 6 }; // instead of tr1::array<int,N> a = {...}

I was disappointed when I first learned of the tr1::array because I
was sure that an initializer would be allowed similar to

int a[] = {1, 4, 6};

Why can't we let the compiler figure out the N?

Such an initializer would help in auto-generated code when N is not
known in advance.

Thanks.

-Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]