public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: VLA <verrola@yahoo.com>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c++/8285: default arg doesn't work in vector
Date: Sat, 19 Oct 2002 08:56:00 -0000	[thread overview]
Message-ID: <20021019155601.8253.qmail@sources.redhat.com> (raw)

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

From: VLA <verrola@yahoo.com>
To: nathan@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
  nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/8285: default arg doesn't work in vector
Date: Sat, 19 Oct 2002 08:50:40 -0700 (PDT)

 Thanks nathan, the vector constructor use the copy
 constructor to create the other n-1 objects of the
 vector when called with vector<T>(n) but it created an
 instance for each element for vector<T>(n, v).
 
 i saw one object was created, i just couldn't figure
 out why the rest weren't.  
 
 Thanks, you r the man.  but Nathan, i can't remember
 reading about this in the C++ Programming Language. 
 Is this how it should work?  I know, my class should
 have a copy constructor if it has pointer members,  i
 just didn't think the vector would use it.  
 
 Thanks again.
 
 .v
 --- nathan@gcc.gnu.org wrote:
 > Synopsis: default arg doesn't work in vector
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: nathan
 > State-Changed-When: Sat Oct 19 08:25:13 2002
 > State-Changed-Why:
 >     I suspect coding error. You have no user defined
 > copy constructor, therefore one is synthesized by
 > the compiler. If it is ever invoked, you'll end up
 > deleting the same int twice.
 >     
 >     Please confirm whether that fixes the problem or
 > not.
 > 
 >
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8285
 
 
 __________________________________________________
 Do you Yahoo!?
 Y! Web Hosting - Let the expert host your web site
 http://webhosting.yahoo.com/


             reply	other threads:[~2002-10-19 15:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-19  8:56 VLA [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-02-23 21:17 neroden
2002-10-19  8:25 nathan
2002-10-19  7:46 verrola

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021019155601.8253.qmail@sources.redhat.com \
    --to=verrola@yahoo.com \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).