220 32532 <9064929.QEV8q21eIZ@tjmaciei-mobl1> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: relaxing rules for ternary operator. Allow
 incompatible types.
Date: Sat, 20 May 2017 12:29:51 -0700
Lines: 50
Approved: news@gmane.org
Message-ID: <9064929.QEV8q21eIZ@tjmaciei-mobl1>
References: <1b5ee8eb-53df-4e98-af2f-829c7bc2e5b2@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"
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1495308598 30138 195.159.176.226 (20 May 2017 19:29:58 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 20 May 2017 19:29:58 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBM5SQLEQKGQEHRUMWWY@isocpp.org Sat May 20 21:29:52 2017
Return-path: <std-proposals+bncBCB4TK757YBRBM5SQLEQKGQEHRUMWWY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oi0-f70.google.com ([209.85.218.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCB4TK757YBRBM5SQLEQKGQEHRUMWWY@isocpp.org>)
	id 1dCA4V-0007hB-6A
	for gclcip-std-proposals@m.gmane.org; Sat, 20 May 2017 21:29:51 +0200
Original-Received: by mail-oi0-f70.google.com with SMTP id n188sf117707130oig.3
        for <gclcip-std-proposals@m.gmane.org>; Sat, 20 May 2017 12:29:56 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1495308596; cv=pass;
        d=google.com; s=arc-20160816;
        b=M9z6M8K5Yl8awhsbUgwC8XHw057yvjVAog5Gx/oyad9/Z/RRnaJ0jjaJjm0Qo6iDhy
         72XJrCZjFuUUzSy+t0lQwCdRHMGFWXkBWkQXqB5Coo81IK4x3XLVFuWYBiVC5Mogzgk2
         /0JIIQDQJKNIPlyUpeg2TobcdIgKxQzL0Yby7nVzY6TOoa+E05kb0dEYENG5FNYGIEyX
         nRwHjsuCAz5F1RXNqIKPlrjmY4v8xZbYenqaOdRApV0ItYutclEaRs6fXMr4B085q8gN
         8AC867A0Pu1M7yehvvE7DqhkvsYndW9TX18QWvy6UlQKPsez7ct7PJiXvMejV7PCC0HT
         sxZw==
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:content-transfer-encoding
         :mime-version:references:in-reply-to:message-id:date:subject:to:from
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=JXG1AdnYqdF9/L7BFX0BHHhETXDAo5iEc4/NZCFGwII=;
        b=mWAZfkkUw7uYVztjPW/AB2sG2aUs+6VyawKvCv0dk5RA6PBoCjGqsqA4W6N9BKG+5B
         TPhHMM6GTILNtLWl1eFq4YAfMCjXTTg52QAiC2T0MhpWejxBoe4fbC2P0djfW6Z40zfe
         epNigD/AVoP4ta3tKNSSOJNqdy2iK4XhcYQrsKyZzL2HJQmmzaOff9p5hHiAtmyf1Q9T
         LY/SaZ8sXF4v45BGBc6yXa+43D5MD1618S193+F+eK81zVG60UTvBobGvsfqx2tRxtFZ
         sTW07uy8ZmMOqqjorEO4bHtmLkCtdw3iIgedD9ZyXyLxk3v65MRIQM07aJ/JzjLh9dfr
         7qzA==
ARC-Authentication-Results: i=2; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) smtp.mailfrom=thiago@macieira.org
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:in-reply-to:references:mime-version
         :content-transfer-encoding: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=JXG1AdnYqdF9/L7BFX0BHHhETXDAo5iEc4/NZCFGwII=;
        b=JLHROXSdxzJCGDdLGCVm63T8Lrp/3LAa446pI1c+JW+TvjAowyCRWfieCB1u3lMo3L
         eQyPefl/50upTOAC6Ffj7WC5Ga8epG7Zh1R3uqwBUxrai19Gql/YrupIMl56+1KQnOoO
         aFCsXlvoFOVx3Q2CAV0Xj+0e6tEbfUfjfFUjLzmNADwS1wy+9nG5q+PPOGc5QMtSWqKc
         Ejvzfbut/1vcIkx7swyJZGOhrB6U1IlYdTSLW9cOJWGt5WePO1i+ECkquAtAE6WRvPDX
         X7Den6ppox1AdU2Umv41ojGl1GJXoPKQrQScs+iBuvPWQj4u7+NwbQwWQtfUN9IB0m11
         C5Zg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
         :references:mime-version:content-transfer-encoding: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=JXG1AdnYqdF9/L7BFX0BHHhETXDAo5iEc4/NZCFGwII=;
        b=povOLPodXveoqF81ZKDmwrwc7sARBmYF0FwpfXuJ4ecTpQxRiTPtCQGf6wtjWt40K/
         eMp+ZAyyIy+QffwzsZUldwQrCwL/ggeR85acYACkcP7Xi7qoCeEz8nYkWWOh/JGmXqzq
         66NezFwxyzWKtp/p2YgAmYHlsthxK4n/cgfsVB0WdG9CHgpPSMEE9M/OFIb7nvmChyCg
         jtH7UhfJN4N3gkaIq+po0CWsy5GbFywdVrK1m0cxznw7ToH0tWrS5t70APMd7VI45zwN
         ttPfyk65B3wtte82IGJolVHp+3AIM1K4NHb8OAACRsBvXly7f81H9T3HnOq2fc9DIeGR
         7ss 
X-Gm-Message-State: AODbwcA3vrNvxPOJdeQkl9xHIvcXq/cOthTp6dS21+8cCKfOY0zVV4xr
	iMBxATd9Yk0+qXJy
X-Received: by 10.157.24.88 with SMTP id t24mr7811777ott.30.1495308595918;
        Sat, 20 May 2017 12:29:55 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.25.17 with SMTP id j17ls1060613ota.8.gmail; Sat, 20 May
 2017 12:29:55 -0700 (PDT)
X-Received: by 10.129.108.215 with SMTP id h206mr12531751ywc.329.1495308595088;
        Sat, 20 May 2017 12:29:55 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1495308595; cv=none;
        d=google.com; s=arc-20160816;
        b=VsFsB7jEc+xVyohbUwnsapwRz2xiG/Pzi5aznY2scq2NAtD4FmqVSysTXCgi/vOGy2
         sC5tcItLtkRdDVMpo1B4eW9Phy0c2y7REetLV7OAG1xhDIrTzjkzORA/SCf+f62rbl9X
         mLlDVwZq8Ne7M37YptWBCx9MOgnUC7RPdJ8SZGep5Brsc06XbyuAdB5Jh5VTyXGDl62/
         UAQReYdFKPHv7J6HIg9hBl5397RDWwkBk+qXg4bUVjZM33go+lJI5+pPOUI7QAgZfOxm
         QBCK70/BVAFKGuDaYGAhdJ+yMIBIMkdtV7gWu5bU5g6gRIEtyfskd98qhD5TvIN80Yl2
         G4Ew==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:to:from:arc-authentication-results;
        bh=atyGQUWJsqH6ZAX7TCRKDnG2ELXCS63TMrwg155CB7k=;
        b=RZDAKjLnCLHZF+l316Z8ZhrozBSbu5PKPGysjcucSz2rDcPUbk8ATmU18McX5RuDx9
         repU2OI8YLm8INxScFJeroU9+zQxYP1Kv0xgOk1mjpZhnq74aC4lbL9m09RIvHfgR0n6
         rdbAbOcd3o815u5Ezctu27ePFiA5bkVqYQx64p2Gs1iHbE1P0V9jz379jgJuX9hVPdhP
         i8KmHvDQXcDClmwZ+qYgKyXCEvIiI5eBh6Iet0ReUdjzbaeatKDvlRAnJpSKIaUEnpWE
         kuiTlN/ovvdr5uOoFc9pR5OppSNXPSSkiPXUrO5oFS6v6SXpp9nNhasEFDq6Up3ylArb
         bYqQ==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) smtp.mailfrom=thiago@macieira.org
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [2a01:4f8:d13:f81:21c:14ff:fe01:12a3])
        by mx.google.com with ESMTP id c16si4371353ywb.155.2017.05.20.12.29.54
        for <std-proposals@isocpp.org>;
        Sat, 20 May 2017 12:29:54 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) client-ip=2a01:4f8:d13:f81:21c:14ff:fe01:12a3;
Original-Received: from tjmaciei-mobl1.localnet (unknown [IPv6:2601:1c0:4501:5f9f:6da5:acd8:4cde:e926])
	by gondolin.macieira.info (Postfix) with ESMTPSA id 4D9BB12C001
	for <std-proposals@isocpp.org>; Sat, 20 May 2017 12:29:53 -0700 (PDT)
In-Reply-To: <1b5ee8eb-53df-4e98-af2f-829c7bc2e5b2@isocpp.org>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3
 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-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:32532
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/32532>

On s=C3=A1bado, 20 de maio de 2017 10:41:56 PDT ma.kalbfuss@web.de wrote:
> Hi Guys,
>=20
> I had the following situation:
>=20
> I have a Group of StaticSet classes with a compatible interface but
> distinct in there concrete type. empty_set is not an intervall!
> I tried the following:
>=20
>=20
> auto dec_digit =3D make_interval('0', '0' + std::min(base, DECIMAL_BASE) =
- 1);
> auto upper_digit =3D (base > DECIMAL_DIGIT) ? make_interval('A', 'A' + (b=
ase
> - 1 - DECIMAL_BASE)) : empty_set;
> auto lower_digit =3D (base > DECIMAL_DIGIT) ? make_interval('a', 'a' + (b=
ase
> - 1 - DECIMAL_BASE)) : empty_set;
>=20
>=20
> Wouldn't it be possible to allow such code, especially in conjunction wit=
h
> concepts?

No. lower_digit must have exactly one type, determined at compile-time. Wha=
t=20
you're asking for would cause the type to be determined at runtime, which i=
s=20
not possible in C++.

Alternatives:
* convert empty_set to make_interval's type
* convert either to a common type (which you need to be explicit about, so =
it=20
   won't work with auto)
* use std::variant<interval, decltype(empty_set)>

--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/9064929.QEV8q21eIZ%40tjmaciei-mobl1.

.
