220 24005 <56A5B65C.7000504@gmail.com> article
Path: news.gmane.org!not-for-mail
From: Cleiton Santoia Silva <cleitonsantoia@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Question about N4447
Date: Mon, 25 Jan 2016 03:45:00 -0200
Organization: VTT
Lines: 59
Approved: news@gmane.org
Message-ID: <56A5B65C.7000504@gmail.com>
References: <aa728646-aa3e-4b0c-b693-348bc0344d26@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
X-Trace: ger.gmane.org 1453700702 12336 80.91.229.3 (25 Jan 2016 05:45:02 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 25 Jan 2016 05:45:02 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCBMVWMTUUNBBUPMS22QKGQE6A6XBPY@isocpp.org Mon Jan 25 06:44:55 2016
Return-path: <std-proposals+bncBCBMVWMTUUNBBUPMS22QKGQE6A6XBPY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ig0-f200.google.com ([209.85.213.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCBMVWMTUUNBBUPMS22QKGQE6A6XBPY@isocpp.org>)
	id 1aNZxM-0004OB-AB
	for gclcip-std-proposals@m.gmane.org; Mon, 25 Jan 2016 06:44:52 +0100
Original-Received: by mail-ig0-f200.google.com with SMTP id rs1sf113094878igb.3
        for <gclcip-std-proposals@m.gmane.org>; Sun, 24 Jan 2016 21:44:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:references:from:organization:message-id:date:user-agent
         :mime-version:in-reply-to: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=8kusY3m+RdIMuRLZ1v8U0ZGyN8oTW6/1Izr/Wh5m+I0=;
        b=EK/DNR0US6WvxlA9yq0XEHraeHlh/i/8AwrhNSZHf7ltnr+sTabZjLFj+js/8ZErGp
         5M5v2POsZT0pLGSEgDzXkx04v51VO6bdcFqhovurPLbnxQwUabaEm9dXiAAH/a1LJ9pP
         DfUgIEqmA+Ms5yJAZNp/m+rlLO+NmndubbwIiMm74xcnvKN9T+gJTJKt6KvwWdyAD7+o
         jLUEi/IMaT/o9Ww+FB3jQQkj5uzhrGz6/DXi9pxYyN4XHinMZXUgrZusX8F9I1F9CNAd
         YXOG0bRUy8cR8xTG4GDVf4XCPVJgXEmttsC/l6f0BY6cDjnncyeqFbSqLu+hYU8zu2NE
      
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:subject:to:references:from:organization
         :message-id:date:user-agent:mime-version:in-reply-to: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=8kusY3m+RdIMuRLZ1v8U0ZGyN8oTW6/1Izr/Wh5m+I0=;
        b=f/krXD+x0hRQ/7/Ayjl2V31cbVsLtsM2d9qekT9z9/jK1YC+1lNd6j2J/pzqPd3ft6
         zmDVsts4szCN0zV1N/xuweVp2mtcIDotYtiVUYwBIp7EEVLAGriAxpzIDOLIAjMMcRKo
         /N9sxFRhv7RtTSZsKIcXxHvS/+2/OS04TVZxHPNxaKMmaIFj+EhXVHih6PBrMnc3VSpT
         yUnmMpU7btU2KiQk/tcTYBu3R7W3bmSzpL7Lo9yJ/WI2fmSnGtp4tuJb6Qzw5eV8+mLx
         v20pMDTmHt/Y61BXb1Xv9IjmuusONhsOKgLOxqi7VSCQbTud5M59SEJVR4JTq+Cl2Smu
  
X-Gm-Message-State: AG10YOTg2zTWhLR1lP9jtw+lG07kDoxB6kbLqz4sB0Av+x379LAlFcs4uVaxvEQZann/OQ==
X-Received: by 10.182.39.138 with SMTP id p10mr7910056obk.16.1453700691195;
        Sun, 24 Jan 2016 21:44:51 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.105.75 with SMTP id b69ls1682822qgf.53.gmail; Sun, 24 Jan
 2016 21:44:49 -0800 (PST)
X-Received: by 10.55.82.214 with SMTP id g205mr18707114qkb.72.1453700689580;
        Sun, 24 Jan 2016 21:44:49 -0800 (PST)
Original-Received: from mail-qk0-x22d.google.com (mail-qk0-x22d.google.com. [2607:f8b0:400d:c09::22d])
        by mx.google.com with ESMTPS id y200si22641844qhy.25.2016.01.24.21.44.49
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 24 Jan 2016 21:44:49 -0800 (PST)
Received-SPF: pass (google.com: domain of cleitonsantoia@gmail.com designates 2607:f8b0:400d:c09::22d as permitted sender) client-ip=2607:f8b0:400d:c09::22d;
Original-Received: by mail-qk0-x22d.google.com with SMTP id o6so50786365qkc.2
        for <std-proposals@isocpp.org>; Sun, 24 Jan 2016 21:44:49 -0800 (PST)
X-Received: by 10.55.77.216 with SMTP id a207mr18798577qkb.80.1453700689359;
        Sun, 24 Jan 2016 21:44:49 -0800 (PST)
Original-Received: from [192.168.0.2] ([177.33.125.174])
        by smtp.gmail.com with ESMTPSA id h64sm8155217qgh.39.2016.01.24.21.44.47
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 24 Jan 2016 21:44:48 -0800 (PST)
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101
 Thunderbird/38.5.1
In-Reply-To: <aa728646-aa3e-4b0c-b693-348bc0344d26@isocpp.org>
X-Original-Sender: cleitonsantoia@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of cleitonsantoia@gmail.com designates 2607:f8b0:400d:c09::22d as
 permitted sender) smtp.mailfrom=cleitonsantoia@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
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:24005
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/24005>


     That would be good, make the expansion in "lock".
     I gave some thoughts on this matter, however there is a problem 
with you syntax, what happens if you ask for typedef<> and typeid<> of 
different classes ?
     This problem can be solved in other way, you can ask for typeid< M 
 >  on each member of typedef<T>, and make other class ( descendant of 
yours ) to encapsulate that :

     template<typename _Member>
     struct Member_son : Member {
         constexpr Memeber(_Member m) : Member(m, typeid<_Member>...) {}
     };


     vector<Member_son> members = { typedef<T>... };

     This should give what you want.


Cleiton

Em 22/01/2016 16:52, gufideg@gmail.com escreveu:
> Hi. I've been thinking about N4447 lately. First, this proposal is wonderful. It's something I dreamt of a long time. Thanks everyone.
>
> I have a question about it: the syntax use the `...` To expand the result. Does this mean it follows all the same rules as the parameter pack expansion? Let me explain.
>
> Let's say we have this struct:
>
>      template<typename Class, typename T>
>      struct Member {
>          constexpr Memeber(T Class::*aMember, const char* aName) : member{aMember}, name{aName} {}
>
>          using Type = T;
>
>          T Class::*member;
>          const char* name;
>      };
>
>      template<typename Class, typename T>
>      constexpr auto makeMember(T Class::*member, const char* name) {
>          return Member<Class, T>{member, name};
>      }
>
> With the current proposal, is it possible to write something like this?
>
>      constexpr auto members = std::make_tuple( makeMember(typedef<AClass>, typeid<AClass>)... );
>
> Note that I used both `typedef<...>`and `typeid<...>` with the same expansion.
>

-- 

--- 
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 https://groups.google.com/a/isocpp.org/group/std-proposals/.

.
