This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: FAQ Entry
- To: mmitchell at usa dot net
- Subject: Re: FAQ Entry
- From: Joe Buck <jbuck at synopsys dot com>
- Date: Wed, 7 Jan 98 8:55:25 PST
- Cc: egcs at cygnus dot com, law at schirf dot cs dot utah dot edu, jbuck at synopsys dot com
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.