From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32539 invoked by alias); 26 Sep 2011 16:27:37 -0000 Received: (qmail 32525 invoked by uid 22791); 26 Sep 2011 16:27:35 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Sep 2011 16:27:21 +0000 Received: from wpaz13.hot.corp.google.com (wpaz13.hot.corp.google.com [172.24.198.77]) by smtp-out.google.com with ESMTP id p8QGRKGQ011063 for ; Mon, 26 Sep 2011 09:27:20 -0700 Received: from iadj38 (iadj38.prod.google.com [10.12.136.38]) by wpaz13.hot.corp.google.com with ESMTP id p8QGQECA004588 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Mon, 26 Sep 2011 09:27:18 -0700 Received: by iadj38 with SMTP id j38so5231444iad.15 for ; Mon, 26 Sep 2011 09:27:18 -0700 (PDT) Received: by 10.42.197.67 with SMTP id ej3mr7672492icb.213.1317054438620; Mon, 26 Sep 2011 09:27:18 -0700 (PDT) Received: by 10.42.197.67 with SMTP id ej3mr7672482icb.213.1317054438504; Mon, 26 Sep 2011 09:27:18 -0700 (PDT) Received: from coign.google.com ([67.218.105.242]) by mx.google.com with ESMTPS id dv19sm26886743ibb.3.2011.09.26.09.27.16 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Sep 2011 09:27:17 -0700 (PDT) From: Ian Lance Taylor To: Liang Wang Cc: gcc@gcc.gnu.org Subject: Re: misleading description in vec.h? References: Date: Mon, 26 Sep 2011 17:35:00 -0000 In-Reply-To: (Liang Wang's message of "Mon, 26 Sep 2011 23:15:26 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg00331.txt.bz2 Liang Wang writes: > Here is comment from line 36, gcc/vec.h > > Both the structure object and pointer variants > pass pointers to objects around -- in the former case the pointers > are stored into the vector and in the latter case the pointers are > dereferenced and the objects copied into the vector. > > But by reading implementation, it seems that this description is reverse. > I think that it should be something like > > in the *latter* case the pointers > are stored into the vector and in the *former* case the pointers are > dereferenced and the objects copied into the vector. > > That is, the pointers in structure object variant are dereferenced and > the objects copied into the vector. I think you are correct and the comment is wrong. Ian