This is the mail archive of the gcc-prs@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]
Other format: [Raw text]

Re: libstdc++/9626: g++ accepts vector<vector<int> > v(2, 4);


The following reply was made to PR libstdc++/9626; it has been noted by GNATS.

From: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
To: paolo@gcc.gnu.org
Cc: gcc-bugs@gcc.gnu.org,  gcc-prs@gcc.gnu.org,  gcc-gnats@gcc.gnu.org,
	  paolo@gcc.gnu.org
Subject: Re: libstdc++/9626: g++ accepts vector<vector<int> > v(2, 4);
Date: 08 Feb 2003 14:48:07 +0100

 paolo@gcc.gnu.org writes:
 
 > Synopsis: g++ accepts vector<vector<int> > v(2, 4);
 > 
 > State-Changed-From-To: analyzed->feedback
 > State-Changed-By: paolo
 > State-Changed-When: Sat Feb  8 13:36:01 2003
 > State-Changed-Why:
 
 >     On second thought, doesn't seem to me that your testcase is
 >     illegal. You are asking for a size 2 vector of size 4 vectors:
 >     there are no implicit conversions which should be prevented by
 >     explicit, since 4 is the argument of the explicit vector(const
 >     A& = A()) constructor of each of them and this seems perfectly
 >     legal.  Agreed?
 
 No. I pass a 4, but the constructor expects an A = vector<int>. The
 only way to make a "vector<int>" from "4" is with an "explicit"
 constructor.
 
 -- 
 	Falk


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