220 2927 <51212821.6040507@bubblescope.net> article
Path: news.gmane.org!not-for-mail
From: Chris Jefferson <chris@bubblescope.net>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: std::optional -- request for feedback on the wording
Date: Sun, 17 Feb 2013 18:57:37 +0000
Lines: 32
Approved: news@gmane.org
Message-ID: <51212821.6040507@bubblescope.net>
References: <c689b87e-bb6f-42a4-83d7-50d1e395d13d@isocpp.org> <511FFA5B.7050204@wanadoo.fr> <CAOHCbitRNNg6gO+ySyN6zz8DgESZYLKyScwD5rA+2tKDLsyx0Q@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
X-Trace: ger.gmane.org 1361127462 26894 80.91.229.3 (17 Feb 2013 18:57:42 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 17 Feb 2013 18:57:42 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCF5NPH6QMFRBJOQQSEQKGQE7DVKJ5A@isocpp.org Sun Feb 17 19:58:04 2013
Return-path: <std-proposals+bncBCF5NPH6QMFRBJOQQSEQKGQE7DVKJ5A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ee0-f72.google.com ([74.125.83.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCF5NPH6QMFRBJOQQSEQKGQE7DVKJ5A@isocpp.org>)
	id 1U79R3-0000Dg-Uc
	for gclcip-std-proposals@m.gmane.org; Sun, 17 Feb 2013 19:58:02 +0100
Original-Received: by mail-ee0-f72.google.com with SMTP id b15sf6402294eek.7
        for <gclcip-std-proposals@m.gmane.org>; Sun, 17 Feb 2013 10:57:42 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=x-received:x-beenthere:x-received:x-received:received-spf
         :x-received:message-id:date:from:user-agent:mime-version:to:subject
         :references:in-reply-to:x-gm-message-state:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-google-group-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=Pe0TOCVPWlq40ZnPOq4QDDZGi5+yXiRhzJrTbalVzlU=;
        b=mhB8rd9tIj2yvxION9SdXPFfRUU+EckEpRhmiM7beoQ51PY1LSxYoER0vQCtWk2q8e
         YfoLgBSZD/TP5/3nQtEku26O++09BVLH2LWZ2S84gknW/tCuFrAYHv4a/k52SItOxMQO
         Nf/3+FIZyhrUNG+nv3NdjTIDbx4GbAaSGUSwvipMRiLI/RpD+aTrerqKu4pj4Nn9jSxT
         yrKNyl816Esdx/9yJQYjQlY1EFJWFIquvEEvyu3PUibgmJB6KOS/LjW6FRTbMsgHwbDT
         F1HIzgr3w 
X-Received: by 10.180.19.132 with SMTP id f4mr2136053wie.2.1361127461976;
        Sun, 17 Feb 2013 10:57:41 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.101.132 with SMTP id fg4ls398451wib.8.gmail; Sun, 17 Feb
 2013 10:57:41 -0800 (PST)
X-Received: by 10.194.109.102 with SMTP id hr6mr14790877wjb.24.1361127461071;
        Sun, 17 Feb 2013 10:57:41 -0800 (PST)
X-Received: by 10.194.109.102 with SMTP id hr6mr14790875wjb.24.1361127461060;
        Sun, 17 Feb 2013 10:57:41 -0800 (PST)
Original-Received: from mail-we0-x230.google.com ([2a00:1450:400c:c03::230])
        by mx.google.com with ESMTPS id d6si21496485wjw.94.2013.02.17.10.57.40
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sun, 17 Feb 2013 10:57:40 -0800 (PST)
Received-SPF: neutral (google.com: 2a00:1450:400c:c03::230 is neither permitted nor denied by best guess record for domain of chris@bubblescope.net) client-ip=2a00:1450:400c:c03::230;
Original-Received: by mail-we0-f176.google.com with SMTP id s43so4089923wey.7
        for <std-proposals@isocpp.org>; Sun, 17 Feb 2013 10:57:40 -0800 (PST)
X-Received: by 10.181.12.103 with SMTP id ep7mr16173737wid.12.1361127460574;
        Sun, 17 Feb 2013 10:57:40 -0800 (PST)
Original-Received: from [192.168.1.183] (94-192-86-137.zone6.bethere.co.uk. [94.192.86.137])
        by mx.google.com with ESMTPS id bg5sm17460095wib.8.2013.02.17.10.57.38
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sun, 17 Feb 2013 10:57:39 -0800 (PST)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2
In-Reply-To: <CAOHCbitRNNg6gO+ySyN6zz8DgESZYLKyScwD5rA+2tKDLsyx0Q@mail.gmail.com>
X-Gm-Message-State: ALoCoQkKFs36rgXWuKBeVTPaFB7vCMzJYPnjSeZ+I5uvbnhYBoIR4ZqA27AqyBgkXlHv0nPKkAEY
X-Original-Sender: chris@bubblescope.net
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 2a00:1450:400c:c03::230 is neither permitted nor denied by best
 guess record for domain of chris@bubblescope.net) smtp.mail=chris@bubblescope.net
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?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:2927
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2927>

On 17/02/13 18:34, Tony V E wrote:
> On Sat, Feb 16, 2013 at 4:30 PM, Vicente J. Botet Escriba
> <vicente.botet@wanadoo.fr> wrote:
>>
>> * optional<T>::optional(const optional<T>& rhs);
>>
>> What about adding a post-condition on the copied value
>> false == bool(rhs) || rhs.value() == this->value()
>>
> You can't guarantee rhs.value() == this->value() for all T.  You are
> probably assuming T is Regular.

In these kinds of situations I find it helpful to look at other parts of 
the standard, for example pair assignment says "effects: Initializes 
members from the corresponding members of the argument".

So don't worry about getting 'code equivalent', in situations like this 
it is fairly obvious what the constructor is supposed to do, so a text 
description is (my opinion) more than sufficient.

Chris

-- 

--- 
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/?hl=en.



.
