220 36980 <CALOpkJBTZ+TyymMbJWMWiTkArQEusFqyAkfLofBoskj57Oe2iA@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Zach Laine <whatwasthataddress@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: const std::map operator []
Date: Tue, 20 Feb 2018 10:17:27 -0600
Lines: 53
Approved: news@gmane.org
Message-ID: <CALOpkJBTZ+TyymMbJWMWiTkArQEusFqyAkfLofBoskj57Oe2iA@mail.gmail.com>
References: <c510e551-256b-4127-8606-2011ab998e3d@isocpp.org> <f6d6791c-9b48-40ce-8f95-c4c5ae2babe8@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="f403045f4f609a97d40565a72574"
X-Trace: blaine.gmane.org 1519143330 32380 195.159.176.226 (20 Feb 2018 16:15:30 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 20 Feb 2018 16:15:30 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCYIDPWPOAIJTFFR2QCRUBBW6UIJW@isocpp.org Tue Feb 20 17:15:26 2018
Return-path: <std-proposals+bncBCYIDPWPOAIJTFFR2QCRUBBW6UIJW@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f71.google.com ([209.85.215.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCYIDPWPOAIJTFFR2QCRUBBW6UIJW@isocpp.org>)
	id 1eoAZg-0007uL-R5
	for gclcip-std-proposals@m.gmane.org; Tue, 20 Feb 2018 17:15:25 +0100
Original-Received: by mail-lf0-f71.google.com with SMTP id v123sf600825lfa.4
        for <gclcip-std-proposals@m.gmane.org>; Tue, 20 Feb 2018 08:17:31 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1519143451; cv=pass;
        d=google.com; s=arc-20160816;
        b=BMyFfJWpmhd2Sc1lZp3pfSoof1ecdx/GcgumYjIc9HvFo09muqLIZ8vUMsBtgtXQuv
         abJ5kQ+3cvyfmZC8/T8fCS8ZBV10B7uYQhBfgeDfWa+fUrLdqyFl9i4TKsolpHVwrgr5
         Pv+QN+5IR+MS70oUYFb9OyC+49EjfCOAkFu/l7Dt317K+yxqNv+PDzZOcTj/N3JzyNAf
         XZtPjSvWm56AUJY7YpO32MEfB4ERm9YuCAkiXu/2J7xJ2c0R5IGXwZ/a9wgv60cewAhY
         6PVfoLNbszu3gCnTpPBBSXHu6zurSDAgcDzu432tWSoFBO00jppkSsKNAwvIIzgLKRym
         Y0qQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date
         :from:references:in-reply-to:mime-version:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=I7sLarYeBXAOe0mt+6EBMlInCzPDDtwCPjKSagVQE5c=;
        b=h0nGpsjpX9kNZEWh87ZiyII3Xc17jPcYkmflg1AfWzH5e9eukY0PBZ0NrtoPjfQPZg
         f9A7IY/KI4LcpUOXbq2/QPo84y2FRrLA5eYBP9pZGtPaniPA94sQ8GFlUujzXwMZT8Vt
         iZ1K9nczZj3UDIB15W5dlxr7+m9CsFwEaiip05vxnyrTnSbsCXdGQSv2bPNpX6myk8l8
         3kCo/bpFmFI9Bbz7dcBN20fDI+shPe7Mcf14/mwaOgmQcnImIsnohYuTy+nCLyxc05Ea
         yPEku7xcZ6c2uu+MxuKPJtJVjXgkn541G5WQYKS12ZNqLO1L9FbUbcHDVYJJGIeip0OD
         qFPQ==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=mUZRnqiu;
       spf=pass (google.com: domain of whatwasthataddress@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=whatwasthataddress@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=I7sLarYeBXAOe0mt+6EBMlInCzPDDtwCPjKSagVQE5c=;
        b=G6afjrhTYN3xXGrk0FcBPRXHjZ3t1wgk2lsFUV4sGATvv06lR8fp6a0n3qh+DPj3CL
         TFKnpbNDRWYzFQl7TdyRyb2bbpu7S5cmScPQA7CgH5NQDdy6MTx/sA/pGxVIjvU2fQNc
         r4LfFsopbUooVjzjDx0tTuW/rvZrY5E8AFErYCIRw1Se65AJal+2kCFy5pSzdyNDgyP6
         ooMRtj0cahtOOEmFuE9wYPseMGBSmq4wEf47wl+GpFKTQvfOeV2IgARbW9s0JYqRqohA
         w6Ppkx0OUhZe9c+UWi2Nxk5e7nlPbilBsQEkmk1SFNq5GLlZh0REC5svCGy3RHVMrTIG
         ekqQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=I7sLarYeBXAOe0mt+6EBMlInCzPDDtwCPjKSagVQE5c=;
        b=uTzXiGVArBH/3nAphEcOqvr6DTUQfacgtQsoIyjP3/64bzNUSHLS/6XZlvaYrscfFc
         bcOBFMKGIfMHlP86Rac1SmJeAb7JCiwBfPy6sHDFrnRwt0mpIIv8xzhzBpVnoIP3ctBB
         OuIvOlguHvHdHMQVa79l1/wFnW/weikIvTx4vWkwiZYdrtqkCu+ncOE1AVA0chUQL5ZJ
         DtlELc8mHWnj+HbUl65bkRCwX6DYzuUtA5CrqnIWSXRhH5y1jH8s/9Xbz5INzgNeuAyy
         rQQJuqPnacRKZU0jQCfAzWs12Ts0FNlmeqJWyaz3vDdqnA3fClXAOUTkmfxGRDQBMb2V
         RLDQ==
X-Gm-Message-State: APf1xPBxuje73Je5OaWeUywne0QNzOV37A7YSkinmWdWgN6rWIC+16RJ
	XWiTVYRLN98NxsuYOP24yklKKw==
X-Google-Smtp-Source: AH8x227oYNtaK4aTqCxvBY6Sxnr8FKmx+FAgH0XCQrxT8wCIKStIO/6Wvh4IFXc9HvpysMjxDT7oBw==
X-Received: by 10.46.62.24 with SMTP id l24mr11374lja.0.1519143451230;
        Tue, 20 Feb 2018 08:17:31 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.46.64.15 with SMTP id n15ls975592lja.6.gmail; Tue, 20 Feb 2018
 08:17:29 -0800 (PST)
X-Received: by 10.46.7.26 with SMTP id 26mr88282ljh.107.1519143449182;
        Tue, 20 Feb 2018 08:17:29 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1519143449; cv=none;
        d=google.com; s=arc-20160816;
        b=I9aWtyHy3ojqsqvTgtIyc0EWjviTDkeF3S/Q2HjAAwc1W4g/PmDQcDmCmP62832RJ4
         ixnFJI6ckC23Eq/E+M/nuHVYFU1kCnhDYf1oh9WqoTM4lHIlqMExXnjbenThNu+K3m+i
         4a40QqbYTXLkFM/6AmQN2drSbCTxMUNI7nNyZbUIo5lSQY7ZUS6sOvl2JFy76OCjc5GL
         8ihjFSGvh1D9N2gCQ/zskeGFnebBvyIa84yyGtJJs9JT4t55uzKtpAaz8dKCx7zSCsc+
         ea4+ai0GI5av6mvcwqdntAhNsM4h9HVcA8xsT6N50hJPRsVCbYzpTnDtm/2/QGB+RFB1
         r9kw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:references:in-reply-to:mime-version
         :dkim-signature:arc-authentication-results;
        bh=Znh/RxfOr/QfwIbQztjBY5x2YjafAFl1b+mGHTJr4Yg=;
        b=H4MZ0Mc6Od3sJa1jaOvtRta7W1gwBcC0jr/OtLCu1G+nlIhd0VzZMgAtBzDITCSOLa
         7lmU9BHNFwrXBC0SSwJ2NhYdIkjIbswMdiW0Jn8Wu/JavzDNmYm3Zk36pYkDwGXZXmBK
         lNKk3GEVzwIM4weWt9N0faRb7tn/np6olqyYxLQtQdKBxK0g+S8LyYMBJo6j+ZKuErgo
         Lig/XHHJ69rqqkbTmmc3/eCpAmlH+A85kJ0iA01huwj7TaHfdGb7hhpk5UEDCwIp1+Yn
         IDTXIWZ8zqZthr734clrbLeWUs0/bQM/cYB5EJ9NFF4m55m9XGQTpBGe8jwC/dIbsTy/
         TuYw==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=mUZRnqiu;
       spf=pass (google.com: domain of whatwasthataddress@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=whatwasthataddress@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id d23sor451747lfb.61.2018.02.20.08.17.29
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Tue, 20 Feb 2018 08:17:29 -0800 (PST)
Received-SPF: pass (google.com: domain of whatwasthataddress@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 10.25.222.207 with SMTP id i76mr82775lfl.133.1519143448384;
 Tue, 20 Feb 2018 08:17:28 -0800 (PST)
Original-Received: by 10.46.41.147 with HTTP; Tue, 20 Feb 2018 08:17:27 -0800 (PST)
In-Reply-To: <f6d6791c-9b48-40ce-8f95-c4c5ae2babe8@isocpp.org>
X-Original-Sender: whatwasthataddress@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=mUZRnqiu;       spf=pass
 (google.com: domain of whatwasthataddress@gmail.com designates 209.85.220.41
 as permitted sender) smtp.mailfrom=whatwasthataddress@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:36980
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/36980>

--f403045f4f609a97d40565a72574
Content-Type: text/plain; charset="UTF-8"

On Tue, Feb 20, 2018 at 7:17 AM, <frederik.hertzum@gmail.com> wrote:

> I've considered doing similar things a few times. I usually opt for
> throwing an exception if the key doesn't match an item however.
>

That's not a very exceptional circumstance, nor is it an error.  An
optional is a much better convention is such code.

Zach

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALOpkJBTZ%2BTyymMbJWMWiTkArQEusFqyAkfLofBoskj57Oe2iA%40mail.gmail.com.

--f403045f4f609a97d40565a72574
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On T=
ue, Feb 20, 2018 at 7:17 AM,  <span dir=3D"ltr">&lt;<a href=3D"mailto:frede=
rik.hertzum@gmail.com" target=3D"_blank">frederik.hertzum@gmail.com</a>&gt;=
</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .=
8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">I&#39;ve =
considered doing similar things a few times. I usually opt for throwing an =
exception if the key doesn&#39;t match an item however.<br></div></blockquo=
te><div><br></div><div>That&#39;s not a very exceptional circumstance, nor =
is it an error.=C2=A0 An optional is a much better convention is such code.=
</div><div><br></div><div>Zach</div><div><br></div></div><br></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CALOpkJBTZ%2BTyymMbJWMWiTkArQEusFqyAk=
fLofBoskj57Oe2iA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALOpkJBTZ%2BTy=
ymMbJWMWiTkArQEusFqyAkfLofBoskj57Oe2iA%40mail.gmail.com</a>.<br />

--f403045f4f609a97d40565a72574--

.
