220 33489 <20170801082645.GA21296@noemi.bahnhof.se> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Magnus Fromreide <magfr@lysator.liu.se>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: P0329R0 falls short for designated initialisers
Date: Tue, 1 Aug 2017 10:26:45 +0200
Lines: 55
Approved: news@gmane.org
Message-ID: <20170801082645.GA21296@noemi.bahnhof.se>
References: <4892340.tBhI7hZKOg@tjmaciei-mobl1>
 <26123866-f4fb-42f6-bd11-9123b5223b8e@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: blaine.gmane.org 1501576014 9708 195.159.176.226 (1 Aug 2017 08:26:54 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 1 Aug 2017 08:26:54 +0000 (UTC)
User-Agent: Mutt/1.8.0 (2017-02-23)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDELLREETMBRBR7WQDGAKGQEGVZRN3A@isocpp.org Tue Aug 01 10:26:49 2017
Return-path: <std-proposals+bncBDELLREETMBRBR7WQDGAKGQEGVZRN3A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f70.google.com ([74.125.82.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDELLREETMBRBR7WQDGAKGQEGVZRN3A@isocpp.org>)
	id 1dcSVn-0001xH-M0
	for gclcip-std-proposals@m.gmane.org; Tue, 01 Aug 2017 10:26:43 +0200
Original-Received: by mail-wm0-f70.google.com with SMTP id x28sf1560562wma.7
        for <gclcip-std-proposals@m.gmane.org>; Tue, 01 Aug 2017 01:26:50 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1501576009; cv=pass;
        d=google.com; s=arc-20160816;
        b=aH+/XRYdhk0z+vD8Aqh6CVEMovT3srsdH7gUvKV7c8vQMG+kHteyuzulsNvA3fyZrP
         fMSVflxuzHH7UewtRPyH3CQW++1KBC4CXa3DHT2MaJEQDNKA1oWgG+CNyXnl50fTkHVl
         6XrStYpZuUNwI/C1dc/Qo+f1yAT61QOEs+VgEZ0LNvBCwNow98nGn6/zefEtB6TxRdih
         +htA0S6URx7Q35QVSEsNqPu/IRTuZxsvhSENKuzdgJdJjY3zz7UmCUiDmt58pKscU6ZV
         UVgFIGGLXR7L6Et6xjO14/PGstOM2tQu+k5tCymIDeZbfCfohQq5RMhV0/6DoSc3P6Md
         F0ZA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:user-agent:in-reply-to
         :content-disposition:mime-version:references:mail-followup-to
         :message-id:subject:to:from:date:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=LGk6qkKSTNI5bsA3oE7wkkWGZdjoSq3Y7imMgamUTZg=;
        b=tDg9i+Gbit6/qbpH1IGaB4/D4hwKFdydaLD05aLHE3P6O7x9Wf4EDmRXgkbx3+zwlD
         M7bm/HHrq45k1LG9udqG+BgrRvL4wYR/n/sl2SQn4yCLyhR78lzca7ItsoqoA9jOsN6z
         6CtMjPhYFLfOW/FBcoPyerBlZtcseQU4zvvjBn1ZnJnfz9Md0p7XT4l96sRwyGygk7rM
         cxchbLg6CYsLXatKLLJI3CQBPswNJADp1ttLOTGFRPeK0NIT+JlwHYNxdY8PUSr0qZ55
         hj4Ckt6mQ5r8fB569ORrjtUX8Ct+Jtnr9E9RJ5ZGlh59TSX+h2cQArbJEspNWMampNjJ 
ARC-Authentication-Results: i=2; mx.google.com;
       spf=pass (google.com: domain of magfr@lysator.liu.se designates 2001:6b0:17:f0a0::3 as permitted sender) smtp.mailfrom=magfr@lysator.liu.se
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:subject:message-id:mail-followup-to:references
         :mime-version:content-disposition:in-reply-to:user-agent
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=LGk6qkKSTNI5bsA3oE7wkkWGZdjoSq3Y7imMgamUTZg=;
        b=LEpzFAr910EsCEkghRLPLfrGtq4SemH9EMGAax8zgmLYhbOUicc6DY7RgYzJNh7LFi
         UFlT6IkCD4dI7KU+xyyRVuYuwL87g6HgDkJBHo2nXwvLrsSn29n9WTp9GBAuFVep82iY
         lbwmsKQXBIgs8SZe5o5/fwOZ45mF4N8e7l/leF/Kot/Irw10o4q8QRBG8VxgV0Daz3V1
         lZ3vNZVY0bpJvsN4FcMBEL250keAlIcjTrR35ZlXa/6mf7icoV5qXlroqpAi72KHBiH7
         bURGkXOGxXxCnKGtmeAetcJ73QU00f1brEQCCRxR6x08t8uUWFAp/60PcoFsiVZcaIDO
         PIdw==
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:subject:message-id:mail-followup-to
         :references:mime-version:content-disposition:in-reply-to:user-agent
         :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=LGk6qkKSTNI5bsA3oE7wkkWGZdjoSq3Y7imMgamUTZg=;
        b=Ycu+iba24R8RWGYv8UZhIAIsL/tZ0JXkVu2bwlHE4ab3tot1k8QBvu0kjBUgp3ZJeX
         dl5T71a9p5bQrJ9kR+xVOHWW0B+wq5ui/bdt9Gxp1Gp6rsREIbTt65j9bIUUmWIO9fvn
         2P+LKn7jFM/8a0oCET++JeK5K1A/vat7Khv8SmsCw3Wj9X+68siguDu+QIAepw0Xcrcx
         RjrSDj/mUVDxg3AVPED3F95lkAB0Yfm6QNVKm/mxeon9ijT9u05k6OmjqpNg6duQ9dY7
         Zi0xfLAcdT+srJm2JSOGdQYliwFeF9R8aJnVWlT/oF/ZFt2G+MsgCMk2bJI 
X-Gm-Message-State: AIVw110nELvcl7rwPow60c2NsUeqgVF08KQYzv9igaRQA9IMbe3uGSq2
	oedgziABdrGW6bwq
X-Received: by 10.28.12.129 with SMTP id 123mr46345wmm.31.1501576009883;
        Tue, 01 Aug 2017 01:26:49 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.25.206.68 with SMTP id e65ls190449lfg.13.gmail; Tue, 01 Aug
 2017 01:26:47 -0700 (PDT)
X-Received: by 10.25.201.207 with SMTP id z198mr6892527lff.153.1501576007369;
        Tue, 01 Aug 2017 01:26:47 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1501576007; cv=none;
        d=google.com; s=arc-20160816;
        b=g+iZMdfQJ7SX5nFC+aamUs6Na0PrO8mnjrnmFXU9Z8QQlCC2EAVKHrUxO4xoEI57yY
         9acg3ov3eqI7ESkMwYrZsUxxyhDfs33hRIbVO/vyN4vIBo6r9zPZONVOAGfnx2FZXamh
         vjkqsIBb4OXOc3MVqbNZR4Pqs+LyNXIohaBwyTa7sY0NlQvwZXcOqzeeIdpTTleIuwSs
         beejxH1kBk97GE8fowzfOj8FDW6vGEaEwGvN7jXaYPUOCbwTj3KyUd6oIn6et0DJV4lT
         eNCZxbtnubWnAZxmZQbS2McqrKnUfHnBtDXiVXkqlaoi5fEuKu2/33ldv1+4L4dLZjHd
         +M2Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=user-agent:in-reply-to:content-disposition:mime-version:references
         :mail-followup-to:message-id:subject:to:from:date
         :arc-authentication-results;
        bh=A3Rk7MFE2OSWZqdq1G/MfQ1CiXbMUzh9dKnAAARTVbY=;
        b=1KkTXqEOHFbnLyd7oDqfzi3743YNM2Y92t6nSpFlgNKJqASwmulxviu2bJg6DUVAQ8
         jjUnK3qmhFFlasIT5aujHrSkaqL2DDvFyzllRRl5Xh6OHBIhFe0cyDjp/7mObA4Jfy8M
         iLlOYziJ7xdi9ooJ6B5kd3b7xA1qcYXxGYN2RrxAO6lQnIT9TiAQWGeNtsaHfELHWXyq
         XyGiBfAARksBpEi62abEk3GaYeo+Uj9U2850tvZey3jwaZKO1o5zTe95x4Aqpz3M5e8V
         XjeWTmrkAu7kD5qYm1RhjNyJhCr02/QAITpi5Ivz6W6ZLu6A5s92U0ONF0lk3FYEhlDy
         plfQ==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=pass (google.com: domain of magfr@lysator.liu.se designates 2001:6b0:17:f0a0::3 as permitted sender) smtp.mailfrom=magfr@lysator.liu.se
Original-Received: from mail.lysator.liu.se (mail.lysator.liu.se. [2001:6b0:17:f0a0::3])
        by mx.google.com with ESMTPS id 24si7103065ljb.142.2017.08.01.01.26.47
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 01 Aug 2017 01:26:47 -0700 (PDT)
Received-SPF: pass (google.com: domain of magfr@lysator.liu.se designates 2001:6b0:17:f0a0::3 as permitted sender) client-ip=2001:6b0:17:f0a0::3;
Original-Received: from mail.lysator.liu.se (localhost [127.0.0.1])
	by mail.lysator.liu.se (Postfix) with ESMTP id D3AC84009D
	for <std-proposals@isocpp.org>; Tue,  1 Aug 2017 10:26:46 +0200 (CEST)
Original-Received: from noemi.bahnhof.se (h-155-4-132-137.NA.cust.bahnhof.se [155.4.132.137])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mail.lysator.liu.se (Postfix) with ESMTPSA id A27DC40093
	for <std-proposals@isocpp.org>; Tue,  1 Aug 2017 10:26:46 +0200 (CEST)
Mail-Followup-To: std-proposals@isocpp.org
Content-Disposition: inline
In-Reply-To: <26123866-f4fb-42f6-bd11-9123b5223b8e@isocpp.org>
X-Virus-Scanned: ClamAV using ClamSMTP
X-Original-Sender: magfr@lysator.liu.se
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of magfr@lysator.liu.se designates 2001:6b0:17:f0a0::3 as permitted
 sender) smtp.mailfrom=magfr@lysator.liu.se
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:33489
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33489>

On Tue, Aug 01, 2017 at 12:32:14AM -0700, Victor Dyachenko wrote:
> More examples
> 
> const ::iovec v[] =
> {
>     ::iovec{.iov_base = buf1, .iov_len = buf1_len },
>     ::iovec{.iov_base = buf2, .iov_len = buf2_len }
> };
> ::writev(fd, v, array_size(v));
> 
> constexpr sockaddr_in my_endpoint =
> {
>     .sin_family = AF_INET,
>     .sin_port = htons(123),
>     .sin_addr = INADDR_ANY
> };

System headers contains lots of insanity.
This is copied from Linux/glibc.

struct sigaction
  {
    /* Signal handler.  */
#ifdef __USE_POSIX199309
    union
      {
        /* Used if SA_SIGINFO is not set.  */
        __sighandler_t sa_handler;
        /* Used if SA_SIGINFO is set.  */
        void (*sa_sigaction) (int, siginfo_t *, void *);
      }
    __sigaction_handler;
# define sa_handler     __sigaction_handler.sa_handler
# define sa_sigaction   __sigaction_handler.sa_sigaction
#else
    __sighandler_t sa_handler;
#endif
    /* more members follows */
  };

This also talks against disallowing member.submember = value initialization
since it is quite reasonable to assume that

sigaction sa = { .sa_handler = &function };

should work.

/MF

-- 
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/20170801082645.GA21296%40noemi.bahnhof.se.

.
