[Bug libstdc++/11638] [3.3.1 prerelease] std::vector assign problem with null pointer constant

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Tue Jul 22 23:43:00 GMT 2003


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.



More information about the Gcc-bugs mailing list