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


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

Re: FAQ Entry


Mark Mitchell writes:
>   Here's another entry for the egcs FAQ, which I thought Joe might
> want in his FAQ as well:

[ problems with vector<int> vi(10, 3); ]

As far as I know, I'm the only one who ever asked the Q on egcs (I think I
reported problems with this as a bug once), so it isn't exactly FA.
Still, I could include it.

But I'm not really happy with the answer.

For one thing, it begs the question of how to create a vector containing
10 unsigned ints, each initialized to 3U.  Yes, I suppose I can write

	vector<unsigned> vu(10, 3U);

since the types are now different.  But this feels artificial.

Don't we really need specializations to do this right?  Then vector<int>
vi(10, 3) could be made to work.


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