220 8366 <2779799.GqlxqVrW4X@tjmaciei-mobl2> article
Path: news.gmane.org!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Obtaining a non-const iterators from a
 const_iterator and a non-const reference to the container
Date: Thu, 02 Jan 2014 11:40:23 -0200
Lines: 24
Approved: news@gmane.org
Message-ID: <2779799.GqlxqVrW4X@tjmaciei-mobl2>
References: <68deff4f-5f1d-440e-b6cd-1e5077a3ff96@isocpp.org> <CAOUeGfv33zyShUKRpPkUtNwoMb41b1fV7FMD0T+t4RcrQqcc5w@mail.gmail.com> <52C5156C.7030601@knejp.de>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: ger.gmane.org 1388670025 32373 80.91.229.3 (2 Jan 2014 13:40:25 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 2 Jan 2014 13:40:25 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBTGYSWLAKGQEIN2HE4Y@isocpp.org Thu Jan 02 14:40:29 2014
Return-path: <std-proposals+bncBCB4TK757YBRBTGYSWLAKGQEIN2HE4Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-fa0-f72.google.com ([209.85.161.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCB4TK757YBRBTGYSWLAKGQEIN2HE4Y@isocpp.org>)
	id 1VyiVh-0002sd-7i
	for gclcip-std-proposals@m.gmane.org; Thu, 02 Jan 2014 14:40:29 +0100
Original-Received: by mail-fa0-f72.google.com with SMTP id k1sf24860246fak.11
        for <gclcip-std-proposals@m.gmane.org>; Thu, 02 Jan 2014 05:40:28 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:to:subject:date:message-id:user-agent
         :in-reply-to:references:mime-version:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=Noy8Dgvheq45fayxOgw0kYOfbqomQQqBcL96hblhSWY=;
        b=aimnUl9SFe1ZdsREmbbClHbwsd0o5y609QjNrAhIwNS3jPyH0N+tlh69erYCtb0X1c
         r75iEt1OnYf/CJlK7ZK95W7Yb1V3UsnEOgUjEX0YpoEHuk82wM3AfeLv6Z3kPpksCQsj
         4mbh89r4FP+3kSM0j3EZxlZEEZSgRYJ8sJS88t272uSlUdL7AAzDe36G2n4eKSjYHl6p
         mz6i93y1hX0ix2yXYBQ75tqH6djroSmc06ED8sFNSaxKk0K4/1mJXnnXKKcNjaV38mZn
         sqTX/oUu0O35KGS1lnDc6NLPcCJY8MeGrhv6ib3WpZPa0K99cHJHTMEFqqHFlcOhnZGg
         cP4Q==
X-Gm-Message-State: ALoCoQnawZ85lijo8UDQbdukJaUBqryVlglBC/Dv6SXLnMrRqD8BWA46gQD1XGrbrwCUjLWfhvOX
X-Received: by 10.180.74.131 with SMTP id t3mr13568156wiv.0.1388670028717;
        Thu, 02 Jan 2014 05:40:28 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.79.161 with SMTP id k1ls959499wix.11.gmail; Thu, 02 Jan
 2014 05:40:27 -0800 (PST)
X-Received: by 10.194.104.66 with SMTP id gc2mr4814953wjb.75.1388670027790;
        Thu, 02 Jan 2014 05:40:27 -0800 (PST)
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [2a01:4f8:d13:f81:21c:14ff:fe01:12a3])
        by mx.google.com with ESMTP id q13si21568192wiv.34.2014.01.02.05.40.27
        for <std-proposals@isocpp.org>;
        Thu, 02 Jan 2014 05:40:27 -0800 (PST)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) client-ip=2a01:4f8:d13:f81:21c:14ff:fe01:12a3;
Original-Received: from tjmaciei-mobl2.localnet (unknown [179.209.204.181])
	by gondolin.macieira.info (Postfix) with ESMTPSA id 18C3511A775
	for <std-proposals@isocpp.org>; Thu,  2 Jan 2014 05:40:27 -0800 (PST)
User-Agent: KMail/4.12 pre (Linux/3.9.10-100+i915fix.fc17.x86_64; KDE/4.11.60; x86_64; git-8054221; 2013-08-01)
In-Reply-To: <52C5156C.7030601@knejp.de>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3
 as permitted sender) smtp.mail=thiago@macieira.org
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:8366
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8366>

On quinta-feira, 2 de janeiro de 2014 08:29:48, Miroslav Knejp wrote:
> You could just make a temporary 
> container and use it for the cast. Unless the iterators track their 
> container (which is probably only the case in debug builds, if at all) 
> this works even better than the advance/distance trick (which is at 
> least quite inefficient for most iterator types).

The iterator doesn't need to track the container for the debug code to be able 
to verify if the const_iterator being passed belongs to that container.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.
