From stdcxx-dev-return-1304-apmail-incubator-stdcxx-dev-archive=incubator.apache.org@incubator.apache.org Fri May 12 22:56:32 2006 Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 38420 invoked from network); 12 May 2006 22:56:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 May 2006 22:56:32 -0000 Received: (qmail 89681 invoked by uid 500); 12 May 2006 22:56:32 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 89659 invoked by uid 500); 12 May 2006 22:56:32 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 89644 invoked by uid 99); 12 May 2006 22:56:32 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 May 2006 15:56:31 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 May 2006 15:56:31 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8AEE6714291 for ; Fri, 12 May 2006 22:56:09 +0000 (GMT) Message-ID: <28350306.1147474569566.JavaMail.root@brutus> Date: Fri, 12 May 2006 22:56:09 +0000 (GMT+00:00) From: "Martin Sebor (JIRA)" To: stdcxx-dev@incubator.apache.org Subject: [jira] Commented: (STDCXX-179) Inserting a Vector into a Vector Corrupts Vector Data In-Reply-To: <23870736.1147474028439.JavaMail.root@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/STDCXX-179?page=comments#action_12383318 ] Martin Sebor commented on STDCXX-179: ------------------------------------- See the thread starting at: http://mail-archives.apache.org/mod_mbox/incubator-stdcxx-dev/200605.mbox/%3c4FA4B7B3231C5D459E7BAD020213A94203DDF281@bco-exchange.bco.roguewave.com%3e > Inserting a Vector into a Vector Corrupts Vector Data > ----------------------------------------------------- > > Key: STDCXX-179 > URL: http://issues.apache.org/jira/browse/STDCXX-179 > Project: C++ Standard Library > Type: Bug > Components: 23. Containers > Versions: 4.1.3 > Environment: All operating systems > Reporter: Craig Chariton > Priority: Critical > > There is an interesting problem that occurs with vectors. Here is the sample code: > #include // for cout, endl > #include // for vector > int main () > { > std::vector a; > a.push_back(1); > a.push_back(2); > a.push_back(3); > a.push_back(4); > std::vector b; > b.push_back(0); > a.insert(a.begin(), b.begin(), b.end()); > for( std::vector::iterator i = a.begin(); i != a.end(); ++i) > std::cout << (*i) << ","; > std::cout << std::endl; > return 0; > } > The output is 0,2,3,1,2, instead of 0,1,2,3,4, . > I tried some other combinations as follows: > a = 1, b = 0 - works, get 0,1 > a = 1,2, b = 0 - works, get 0,1,2 > a = 1,2,3, b = 0 - fails, get 0,2,1,2 > a = 1,2,3, b = 0, 5 - fails, get 0,5,3,2,3 > a = 1,2, b = 0,5 - works, get 0,5,1,2 > a = 1,2,3,4, b = 0,5 - works, get 0,5,1,2,3,4 > a = 1,2,3,4,5, b = 0,5 - fails, get 0,5,3,1,2,3,5 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira