220 4979 <CAGNvRgD7uhZCgJsUfnpNJ5iur5QbAG3bPcP9XgB0d1kxZ0ou+g@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: std::optional - move is conditionally nothrow,
 what about copy?
Date: Tue, 11 Jun 2013 21:56:43 +0200
Lines: 46
Approved: news@gmane.org
Message-ID: <CAGNvRgD7uhZCgJsUfnpNJ5iur5QbAG3bPcP9XgB0d1kxZ0ou+g@mail.gmail.com>
References: <a157657e-acfb-457a-88d2-973f95308356@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1370980606 4879 80.91.229.3 (11 Jun 2013 19:56:46 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 11 Jun 2013 19:56:46 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCT7RVFA4QORB7EB32GQKGQEU5COHEQ@isocpp.org Tue Jun 11 21:56:48 2013
Return-path: <std-proposals+bncBCT7RVFA4QORB7EB32GQKGQEU5COHEQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wi0-f197.google.com ([209.85.212.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCT7RVFA4QORB7EB32GQKGQEU5COHEQ@isocpp.org>)
	id 1UmUgP-00079b-6T
	for gclcip-std-proposals@m.gmane.org; Tue, 11 Jun 2013 21:56:45 +0200
Original-Received: by mail-wi0-f197.google.com with SMTP id hj3sf2633205wib.0
        for <gclcip-std-proposals@m.gmane.org>; Tue, 11 Jun 2013 12:56:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-beenthere:mime-version:in-reply-to:references:date:message-id
         :subject:from:to: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:content-transfer-encoding;
        bh=/H4+G0qy90yJAfhc4TFjNsXcr4D7Nnjjjf/9ZkoDxpo=;
        b=AdTxf42W7yVrXT5TmEx1ePAiR/RcN3NxIedsyvN6qUqPPE4/Wn+y61eA7wvMBXAK7x
         Lf3EtPJMD8Qf33FX+l5XkUQW0b4+cct2kaxcI5/5ILQ/LKy4ecXXk8/ZoOlgx4R5R8F1
         eO7bNn5WRoVwWCWSfSP6QOOZ1Wvox0EK/H5hKVntt9llcKXPDnEeLUVBBz8LhXf8F++f
         avzg9E2vLOaHB7dfX+um2C7p1ODtKoLZ+2EMCw0aMsgp+XiNE/qKT8ygKhisVeSnyOTd
         FLPSiWtApuPdrS6ULShtzzUOrzBpNr6IuNexnxg78JSOB3ejouKE61QWWa4FX5UjuNy3
         hSdw==
X-Received: by 10.180.95.5 with SMTP id dg5mr1852458wib.6.1370980604920;
        Tue, 11 Jun 2013 12:56:44 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.95.35 with SMTP id dh3ls1382068wib.7.canary; Tue, 11 Jun
 2013 12:56:43 -0700 (PDT)
X-Received: by 10.180.81.169 with SMTP id b9mr2398233wiy.12.1370980603706;
        Tue, 11 Jun 2013 12:56:43 -0700 (PDT)
Original-Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [2a00:1450:400c:c00::22d])
        by mx.google.com with ESMTPS id om5si5958091wjc.29.2013.06.11.12.56.43
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 11 Jun 2013 12:56:43 -0700 (PDT)
Received-SPF: pass (google.com: domain of daniel.kruegler@gmail.com designates 2a00:1450:400c:c00::22d as permitted sender) client-ip=2a00:1450:400c:c00::22d;
Original-Received: by mail-wg0-f45.google.com with SMTP id j13so963353wgh.24
        for <std-proposals@isocpp.org>; Tue, 11 Jun 2013 12:56:43 -0700 (PDT)
X-Received: by 10.180.206.70 with SMTP id lm6mr2386433wic.50.1370980603638;
 Tue, 11 Jun 2013 12:56:43 -0700 (PDT)
Original-Received: by 10.217.119.134 with HTTP; Tue, 11 Jun 2013 12:56:43 -0700 (PDT)
In-Reply-To: <a157657e-acfb-457a-88d2-973f95308356@isocpp.org>
X-Original-Sender: daniel.kruegler@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of daniel.kruegler@gmail.com designates 2a00:1450:400c:c00::22d as
 permitted sender) smtp.mail=daniel.kruegler@gmail.com;       dkim=pass header.i=@gmail.com
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:4979
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4979>

2013/6/11 R=F3bert D=E1vid <lrdxgm@gmail.com>:
> Hello,
>
> I just noticed that in the last draft, std::optional<T> has a move
> constructor that is nothrow(is_nothrow_move_constructible<T>::value), and
> has a move-assignment operator that is
> nothrow(is_nothrow_move_assignable<T>::value &&
> is_nothrow_move_constructible<T>::value) (I think move-constructable for =
the
> case of assigning to a disengaged object).
>
> Now, there are no similar requirements for the copy constructor. Is there
> any reason why is it not nothrow(is_nothrow_copy_constructible<T>::value)=
,
> and similarly for the move-assignment operator?

The rationale for the lack of this specification is that during the
introduction of noexcept in the library it was decided that
move-operations and swap operations are (a) often noexcept and (b)
fundamental enough to justify that they will always get a - possibly
conditional - exception specification. Copying is fundamental, but it
generally has not a fundamental restriction to be noexcept (see the
special assumptionas that the library can make, if move operations may
throw exceptions).

See also

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3279.pdf

were a set of guidelines was suggested.

- Daniel

--=20

---=20
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 e=
mail 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-proposa=
ls/?hl=3Den.



.
