This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/11638] [3.3.1 prerelease] std::vector assign problem with null pointer constant
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jul 2003 23:43:39 -0000
- Subject: [Bug libstdc++/11638] [3.3.1 prerelease] std::vector assign problem with null pointer constant
- References: <20030722231912.11638.nick@ilm.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11638
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
------- Additional Comments From bangerth at dealii dot org 2003-07-22 23:43 -------
Your code is wrong. There are two assign functions, one taking two
input iterators and one taking an element of type T and a count, which
is an unsigned integer. By giving two signed integers, the first of these
functions is taken, although you want the second one. You must specify this
by either giving an explicit template argument, or by casting one of
the arguments.
Alternatively, use
v.assign(5,0U);
W.