220 4615 <CAGNvRgDUaqiCXbGED6fQ0G-igZuu-u-c+4-+LXm16fZS4-82Bg@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: When to use DefaultConstructible and
 is_default_constructible in the standard text
Date: Mon, 27 May 2013 08:31:07 +0200
Lines: 57
Approved: news@gmane.org
Message-ID: <CAGNvRgDUaqiCXbGED6fQ0G-igZuu-u-c+4-+LXm16fZS4-82Bg@mail.gmail.com>
References: <51A2FB00.1010206@wanadoo.fr>
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 1369636269 8080 80.91.229.3 (27 May 2013 06:31:09 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 27 May 2013 06:31:09 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCT7RVFA4QORBLP3ROGQKGQETSGQO2Y@isocpp.org Mon May 27 08:31:10 2013
Return-path: <std-proposals+bncBCT7RVFA4QORBLP3ROGQKGQETSGQO2Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wi0-f200.google.com ([209.85.212.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCT7RVFA4QORBLP3ROGQKGQETSGQO2Y@isocpp.org>)
	id 1Ugqxa-00062Z-Ed
	for gclcip-std-proposals@m.gmane.org; Mon, 27 May 2013 08:31:10 +0200
Original-Received: by mail-wi0-f200.google.com with SMTP id c10sf1535744wiw.7
        for <gclcip-std-proposals@m.gmane.org>; Sun, 26 May 2013 23:31:10 -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;
        bh=18XDqtBfvYdMWuaK8XBNMUpyBgQnwGa4bnlseFuuU9M=;
        b=cBT42A4AadzpkAQvNlkqtUqyKsTugT0D/zWHgTFdpcDSG58v+JFNlcjKPwknvR3SGt
         7rCq8q2f4q1BqPo7SAeMQcv/xTQbioWi28tf9r3+6acyM3LbiBPieTeE3psBMz54MkzH
         nHW0oe/IV2rj7bHEHZbKK7WAvDEiM5GW6Fm5exj19KEpHHSIXSUp2g9SZ3O5UpbPMq3o
         CiThiSd17Yz9G3UcCSAt792clOxYa3aPH3+Om+kU24D9HSwiwGTUB+crXk6h6Z3PgBZD
         dXbubEgNvHkRJW0cgOJYhy67Y2N4m7OGmM9M3RSsknWklEOIG6oE/hT/2dbdaONPPVdw
         BoFw==
X-Received: by 10.180.11.232 with SMTP id t8mr3115560wib.3.1369636270055;
        Sun, 26 May 2013 23:31:10 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.211.106 with SMTP id nb10ls746209wic.39.canary; Sun, 26
 May 2013 23:31:08 -0700 (PDT)
X-Received: by 10.194.249.37 with SMTP id yr5mr7555098wjc.45.1369636268527;
        Sun, 26 May 2013 23:31:08 -0700 (PDT)
Original-Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [2a00:1450:400c:c03::22d])
        by mx.google.com with ESMTPS id dd1si3829030wjc.80.2013.05.26.23.31.07
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sun, 26 May 2013 23:31:07 -0700 (PDT)
Received-SPF: pass (google.com: domain of daniel.kruegler@gmail.com designates 2a00:1450:400c:c03::22d as permitted sender) client-ip=2a00:1450:400c:c03::22d;
Original-Received: by mail-we0-f173.google.com with SMTP id p57so4037784wes.4
        for <std-proposals@isocpp.org>; Sun, 26 May 2013 23:31:07 -0700 (PDT)
X-Received: by 10.180.183.139 with SMTP id em11mr7107139wic.16.1369636267454;
 Sun, 26 May 2013 23:31:07 -0700 (PDT)
Original-Received: by 10.216.164.9 with HTTP; Sun, 26 May 2013 23:31:07 -0700 (PDT)
In-Reply-To: <51A2FB00.1010206@wanadoo.fr>
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:c03::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:4615
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4615>

2013/5/27 Vicente J. Botet Escriba <vicente.botet@wanadoo.fr>:
>  Hi,
>
> s this a minor historic editorial issue?

No.

> The standard uses DefaultConstructible and is_default_constructible
> indistinctly in the Requires clauses:
>   - T shall satisfy the requirements of DefaultConstructible
>   - is_default_constructible<T>::value is true
>
> * Do those descriptions mean the same thing?

No. A requirement DefaultConstructible has *both* semantic and
syntactic requirements, a requirement based on
is_default_constructible has mainly syntactic requirements (The only
exception would be the requirements on using that trait itself). What
is_default_constructible tests is also a *single* syntactic test,
while DefaultConstructible does more than this (see Table 19).

> If yes, shouldn't the trait be
> defined in function of the Requirements?

No. The design was intentionally done to concentrate on purely
syntactic tests. The originally proposed concepts allowed to express
the textual requirements expressed in language form. I think what you
want to realize is by looking into the directions of concepts (light).

> * Which one should be used on the Requires clauses?

It depends on what you want to realize. Keep in mind that focusing on
is_default_constructible (or other such traits) alone provides less
information and may be insufficient. It should be used only, if the
situation allows this (e.g. for very simple wrapper types such as
pair/tuple, maybe optional) or if expressing the remaining
requirements by additional text can be done easily. The traits were
also very much useful compared to the actual textual requirement set,
if a wrapper has to support *both* reference types and object types
(pair/tuple). While there was an attempt to make the textual
requirements work with references, this approach looks broken to me,
see also

http://cplusplus.github.io/LWG/lwg-active.html#2146

- Daniel

-- 

--- 
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.



.
