220 24303 <4718878.Khnkm2gQof@tjmaciei-mobl4> article
Path: news.gmane.org!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Choosing value categories using a specialized
 traits class
Date: Wed, 10 Feb 2016 10:51:51 -0800
Lines: 47
Approved: news@gmane.org
Message-ID: <4718878.Khnkm2gQof@tjmaciei-mobl4>
References: <fe08947f-f85a-4f37-970f-0f057b5b9697@isocpp.org> <20160210161034.4898896.57740.4502@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1455130324 13252 80.91.229.3 (10 Feb 2016 18:52:04 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 10 Feb 2016 18:52:04 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBSUN522QKGQERVKXYSA@isocpp.org Wed Feb 10 19:51:55 2016
Return-path: <std-proposals+bncBCB4TK757YBRBSUN522QKGQERVKXYSA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f198.google.com ([209.85.217.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCB4TK757YBRBSUN522QKGQERVKXYSA@isocpp.org>)
	id 1aTZrn-0005p3-Jk
	for gclcip-std-proposals@m.gmane.org; Wed, 10 Feb 2016 19:51:55 +0100
Original-Received: by mail-lb0-f198.google.com with SMTP id jx7sf9242455lbc.2
        for <gclcip-std-proposals@m.gmane.org>; Wed, 10 Feb 2016 10:51:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:to:subject:date:message-id:user-agent:in-reply-to:references
         :mime-version:content-transfer-encoding:content-type
         :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=zC9qW6IbB20wBd60tYcj428WCKJzsHhSq4nCMiGxZuo=;
        b=nNbfiuIam6V5k19cHfBUJ/bYwJQCkERdaFdwtB0wJ6Miceo3VrLzg07uHtNeoX5mRQ
         rCEjFobe8jtpZkOqO/uQjweeli5CpOrD993GG4yZXcGUCb5wcQ2u5RKpMW/DgYD0L1VY
         uMCS1j4NK4QIONNGYfp7wM8mx0tgDR7K3e/B5UmtEryVFXZGncM2eer1ar4quhAfIIGH
         Z6mD4K02Gb03p434vtp41ov2vzrRcrBB18zNLSnZKfZ15B+bPqNxINI5NlMMYcgn85W1
         WHaXeyeNFoLNpYmsD5bIOCp4G+EvldYFbidVc61nadvNg42GnjscAREhHgnsB 
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:content-transfer-encoding
         :content-type: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=zC9qW6IbB20wBd60tYcj428WCKJzsHhSq4nCMiGxZuo=;
        b=Xls4a6cFrsm1ajgtDurSG7RJsf24hHK8UZdhojp4vO8z5e+zBki72JN9YiYtNaJq+Q
         me2gWGn0l8lIHvdy2gMz1/xtpjHQXABeFlzltcZXwO72wnMZrSWNE28F85Fbokj00Wx9
         LO0ElXMzw/eEXinF4YPaLvwaZJLb68aqO5gcaoxIMv+SNhCW9/4G+A1YmvVcLqZgkDGa
         2Nu142YGh3tb8dcdcPNtcKw1MMwzWspMiJpOvhZe1jxytgEmDII/DEGQWjrUTNw/AVvH
         2Di1QGHRNOmxQmTWfk/k5cY/JhL+MyECqDGaNScyq3ewrFirzDvOanL3s 
X-Gm-Message-State: AG10YOQB5QCR9iMV3amP6V7tZDsMUq47XyGt8k6mZILjfkr7RjlkzBFQ935GtvJ8laqljg==
X-Received: by 10.194.171.198 with SMTP id aw6mr5041737wjc.1.1455130315160;
        Wed, 10 Feb 2016 10:51:55 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.47.195 with SMTP id v186ls236775wmv.21.gmail; Wed, 10 Feb
 2016 10:51:54 -0800 (PST)
X-Received: by 10.194.175.198 with SMTP id cc6mr41761078wjc.24.1455130314027;
        Wed, 10 Feb 2016 10:51:54 -0800 (PST)
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [78.47.120.188])
        by mx.google.com with ESMTP id y142si32197080wmd.54.2016.02.10.10.51.53
        for <std-proposals@isocpp.org>;
        Wed, 10 Feb 2016 10:51:54 -0800 (PST)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 78.47.120.188 as permitted sender) client-ip=78.47.120.188;
Original-Received: from tjmaciei-mobl4.localnet (unknown [134.134.139.76])
	by gondolin.macieira.info (Postfix) with ESMTPSA id 7DAB611AC3C
	for <std-proposals@isocpp.org>; Wed, 10 Feb 2016 10:51:53 -0800 (PST)
User-Agent: KMail/5.1.1 (Linux/4.4.0-3-default; KDE/5.18.0; x86_64; ; )
In-Reply-To: <20160210161034.4898896.57740.4502@gmail.com>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 78.47.120.188 as permitted sender) smtp.mailfrom=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-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:24303
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/24303>

On quarta-feira, 10 de fevereiro de 2016 11:10:34 PST Tony V E wrote:
> Not a bad idea.=20
>=20
> But I'd rather see some kind of language feature for param passing. A "pa=
ss
> by copy if cheap"=E2=80=8E syntax. Also a pass by copy-if-write (for case=
s where
> the function body I available to determine that).=20
>=20
> Vaguely speaking.

Agreed.

For my Qt6 QVector, I have:

    typedef typename std::conditional<std::is_fundamental<T>::value ||=20
std::is_pointer<T>::value, T, const T &>::type parameter_type;

Which is "good enough", but could be better. It won't catch trivial types t=
hat=20
can be passed in registers, such as structs with size less than a register =
(or=20
two).

Maybe we want a type trait (name TBD) that is true for those types. The=20
standard should say that it is true at least for fundamental types and=20
pointers, the rest to be implementation-defined.

This also goes back to the discussion on relocatable types and the destruct=
ive=20
move.

--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center

--=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 https://groups.google.com/a/isocpp.org/group/std-propos=
als/.

.
