Prev: best way to disambiguate an overloaded function.
Next: conversion from `std::_List_iterator<int>' to non-scalar type `std::_List_iterator<int*>' requested
From: Rodolfo Lima on 7 Jul 2010 05:11 On Jul 3, 7:50 pm, Rodolfo Lima <rodo...(a)rodsoft.org> wrote: > In my proposal, in cases where the list's size isn't needed at compile > time, the partial specialization would be used, making > initializer_list not dependent on list's size (would be the case for > std::vector, for instance). Only when I *want* different > instantiations for different sizes the base template (dependent on > list's size) would be used. The way I see it is a win-win situation, > isn't it? Does anyone think that this might be a solution to the problem of constexpr initializer_list::size? And, of course, does the time window to add it to the FCD is still open? Cheers, Rodolfo Lima -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]
From: Daniel Krügler on 7 Jul 2010 12:49
On 7 Jul., 22:11, Rodolfo Lima <rodo...(a)rodsoft.org> wrote: > On Jul 3, 7:50 pm, Rodolfo Lima <rodo...(a)rodsoft.org> wrote: > > > In my proposal, in cases where the list's size isn't needed at compile > > time, the partial specialization would be used, making > > initializer_list not dependent on list's size (would be the case for > > std::vector, for instance). Only when I *want* different > > instantiations for different sizes the base template (dependent on > > list's size) would be used. The way I see it is a win-win situation, > > isn't it? > > Does anyone think that this might be a solution to the problem of > constexpr initializer_list::size? And, of course, does the time window > to add it to the FCD is still open? It is probably best to have a full-fledged proposal.[1] This proposal should also respond to expected questions in regard to the two template parameters instead of one and should emphasize which problems it solves (and which it doesn't). Don't take this too light-hearted: You probably have to guess the chances of acceptance of such a proposal because an FCD will typically change slightly and only if really needed. A second problem is: This proposal would probably have worse chances in the future, because you would then break programs that rely on the fact the std::initializer_list has only one template parameter currently (e.g. programs that use a template template parameter). I don't want to discourage you, but I attempt to give a fair estimate, because I know that providing such a proposal is a lot of work. As a personal opinion - and not more! - I would recommend to make instead a proposal that requires that the size() function of std::initializer_list is required to be constexpr in all situations without adding another template parameter - this solution would not introduce the two parameters and it would solve the problem for all cases. HTH & Greetings from Bremen, Daniel Kr�gler [1] I just replied to a similar posting in regard to the way of submitting an official proposal, so here only a short description: Write a proposal as html or PDF and send it to the e-mail address given on top of http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html because this is a library-related problem. -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] |