220 32215 <14a2d202-4b34-4e5b-b4f7-bfcfe090408f@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Dan Raviv <dan.raviv@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Allow to access member typedefs of a type from a
 reference type that's referring to that type
Date: Thu, 27 Apr 2017 13:23:22 -0700 (PDT)
Lines: 104
Approved: news@gmane.org
Message-ID: <14a2d202-4b34-4e5b-b4f7-bfcfe090408f@isocpp.org>
References: <DM5PR2201MB151446C188D54CABB6E0FE9C87240@DM5PR2201MB1514.namprd22.prod.outlook.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_15_269917534.1493324602096"
X-Trace: blaine.gmane.org 1493324604 27040 195.159.176.226 (27 Apr 2017 20:23:24 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 27 Apr 2017 20:23:24 +0000 (UTC)
Cc: walter.heisenbug@outlook.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC5YJREBWAGRBOVGRHEAKGQEVXLE5HY@isocpp.org Thu Apr 27 22:23:19 2017
Return-path: <std-proposals+bncBC5YJREBWAGRBOVGRHEAKGQEVXLE5HY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f197.google.com ([209.85.217.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC5YJREBWAGRBOVGRHEAKGQEVXLE5HY@isocpp.org>)
	id 1d3pwc-0006uN-0K
	for gclcip-std-proposals@m.gmane.org; Thu, 27 Apr 2017 22:23:18 +0200
Original-Received: by mail-ua0-f197.google.com with SMTP id z29sf7754254uab.0
        for <gclcip-std-proposals@m.gmane.org>; Thu, 27 Apr 2017 13:23:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=QqsnbHRaucLsCe7wE5WZ3zg2NTWZ0u6Sxmi/BDy+tmQ=;
        b=iKuG6Y5e/si+PQCV1188qQl/KYjRiIR1w94SYZs/rhENX0/zP4uB4X5XHHZno+tEr/
         /xD2Oy/DmzO4HECEFiYHA3gGNud38J8L0LgY/BG8IPrxWQZ72X/l9yc/VV0Y1LP6CzjH
         8BxYExTFoVFQ9SDOaJDgkXugU0TshEwh7vlgE4xd7p2z0/jaez+wTzWqKknmEDAbWAMC
         uWpvqbFs0thK0lrGcNHestP769Y9xHq5tdxc52nUDpaTaDwG4NnI5kesQQ69zFqHNqa2
         iXQFk5/4fN9qrBCnm/jO8MzotuyQXOT0M6Qd5tHSPpXBAfVkyZ8U4DMsOWhqTOBj7Umt
         HiQQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=QqsnbHRaucLsCe7wE5WZ3zg2NTWZ0u6Sxmi/BDy+tmQ=;
        b=YlR6hQymd2hsRVPQ0ieyqH3TDWAud9dYTQGzvAHkpUDfmFPt8Yc06hExv+RtnfkZgq
         oWiW+tKvI0Uqjz9iRB4Hj/mplEXGFGaY96yB881KBv0yNtqVMr1xyrHPw9PKkZ7CVrmC
         CE2f8xYHy5p5crFwcmmWPDqtVDnC57YIygJvV9pO8c6A0EwIZYYfFK28UiYMeaco0vkU
         YmvVzl55FS5Gr/3ak5gJG8TJ+ovMhfXy0w6uZDYX0j6DCba0CrT376b6T3j4AsWy33w/
         GT7GKXtq8KwDw7GXp9Q1GNdfLE+KJtUqDg1Wi9sHKDCsuYGnZeTmhzPV7rmmNrI1ueUK
         ty3A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=QqsnbHRaucLsCe7wE5WZ3zg2NTWZ0u6Sxmi/BDy+tmQ=;
        b=fYy9c8Yadh3Qu5DWMexlTVBfDIN+MhuhCC4agl9Glf1aEZc9ulzBBk3SrMSrLHGr/1
         8OGKEh5ngsCm6Kz9oyYypv+z5eBYQWAjUYJmvQnGX+n9EDTs5CHWvbSUlCp7M86u34eh
         SRxrpbNBwV8H0DzcIc2lriNhcRsGD3O2Dh5tsYyo5JJi8WE3qtPigAczvkASRJoUdOX0
         8vVVu2PGQLBjI/QgYaw72eqf8Os7GAqjELa6tTUs/ehlzmLiLC4L90GME9cf5dQ+jPPr
         twFg46t8u7pmeM1d7DxARtDLBjzsxiuaaL6ZAop86Zd8T79H7lX5ug0cA67COJ+NQLW9
         7E5g==
X-Gm-Message-State: AN3rC/54o4VgnOgdxIY7SxD158BFx009m0RiOCUeqjtj8wzfoARv2DlQ
	VN+5JH3LR2qGtA==
X-Received: by 10.31.164.14 with SMTP id n14mr2878833vke.36.1493324603458;
        Thu, 27 Apr 2017 13:23:23 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.40.137 with SMTP id s9ls4258586ota.44.gmail; Thu, 27 Apr
 2017 13:23:22 -0700 (PDT)
X-Received: by 10.157.17.23 with SMTP id g23mr34828ote.4.1493324602568;
        Thu, 27 Apr 2017 13:23:22 -0700 (PDT)
In-Reply-To: <DM5PR2201MB151446C188D54CABB6E0FE9C87240@DM5PR2201MB1514.namprd22.prod.outlook.com>
X-Original-Sender: dan.raviv@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: <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:32215
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/32215>

------=_Part_15_269917534.1493324602096
Content-Type: multipart/alternative; 
	boundary="----=_Part_16_1675324590.1493324602096"

------=_Part_16_1675324590.1493324602096
Content-Type: text/plain; charset=UTF-8

+1 for this non-breaking feature which has a similar precedent 
(cv-qualifiers listed in Richard's answer), and which would simplify 
writing (and *reading*) generic code.

Cheers,
Dan

On Tuesday, March 14, 2017 at 7:03:06 PM UTC+1, Walter Heisenbug wrote:
>
> Currently to access a member type from a reference type means you have to 
> do all the dancing with removing the reference. 
>
> template<typename T> 
> void f(T&& x) 
> { 
>     typedef typename std::remove_reference_t<T>::member_type mem; 
>     mem y; 
>     use(std::forward<T>(x), y); 
> } 
>
> This could be simplified, if we allow to access the member types of a type 
> from a reference types: 
>
> template<typename T> 
> void f(T&& x) 
> { 
>     typedef typename T::member_type mem; 
>     mem y; 
>     use(std::forward<T>(x), y); 
> } 
>
> I'm not aware of any potential problems, since the reference types don't 
> have any member types, so there's no ambiguity with the existing code. 

-- 
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/14a2d202-4b34-4e5b-b4f7-bfcfe090408f%40isocpp.org.

------=_Part_16_1675324590.1493324602096
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">+1 for this non-breaking feature which has a similar prece=
dent (cv-qualifiers listed in Richard&#39;s answer), and which would simpli=
fy writing (and *reading*) generic code.<br><br>Cheers,<div>Dan</div><div><=
br>On Tuesday, March 14, 2017 at 7:03:06 PM UTC+1, Walter Heisenbug wrote:<=
blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bord=
er-left: 1px #ccc solid;padding-left: 1ex;">Currently to access a member ty=
pe from a reference type means you have to do all the dancing with removing=
 the reference.=20
<br>
<br>template&lt;typename T&gt;
<br>void f(T&amp;&amp; x)
<br>{
<br>=C2=A0=C2=A0=C2=A0 typedef typename std::remove_reference_t&lt;T&gt;::<=
wbr>member_type mem;
<br>=C2=A0=C2=A0=C2=A0 mem y;
<br>=C2=A0=C2=A0=C2=A0 use(std::forward&lt;T&gt;(x), y);
<br>}
<br>
<br>This could be simplified, if we allow to access the member types of a t=
ype from a reference types:
<br>
<br>template&lt;typename T&gt;
<br>void f(T&amp;&amp; x)
<br>{
<br>=C2=A0 =C2=A0 typedef typename T::member_type mem;
<br>=C2=A0 =C2=A0 mem y;
<br>=C2=A0 =C2=A0 use(std::forward&lt;T&gt;(x), y);
<br>}
<br>
<br>I&#39;m not aware of any potential problems, since the reference types =
don&#39;t have any member types, so there&#39;s no ambiguity with the exist=
ing code. </blockquote></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/14a2d202-4b34-4e5b-b4f7-bfcfe090408f%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/14a2d202-4b34-4e5b-b4f7-bfcfe090408f=
%40isocpp.org</a>.<br />

------=_Part_16_1675324590.1493324602096--

------=_Part_15_269917534.1493324602096--

.
