220 33734 <41733595.o4GQ0c89LU@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: Re: A more advanced switch
Date: Wed, 09 Aug 2017 12:38:43 -0700
Lines: 34
Approved: news@gmane.org
Message-ID: <41733595.o4GQ0c89LU@tjmaciei-mobl1>
References: <f8c908e2-d06f-4cd1-bda0-fe2b97fd21f1@isocpp.org> <574320af-c1ae-4676-883c-ae4e91fcd874@isocpp.org> <CAOHCbisLgTxLz75Em3Had35AecQrtpRZKFWRaMXUZsSVtN7Fng@mail.gmail.com>
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 1502307568 15847 195.159.176.226 (9 Aug 2017 19:39:28 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 9 Aug 2017 19:39:28 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBWWJVXGAKGQE6OCIAEA@isocpp.org Wed Aug 09 21:39:16 2017
Return-path: <std-proposals+bncBCB4TK757YBRBWWJVXGAKGQE6OCIAEA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f72.google.com ([209.85.215.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCB4TK757YBRBWWJVXGAKGQE6OCIAEA@isocpp.org>)
	id 1dfWoy-0002jb-5p
	for gclcip-std-proposals@m.gmane.org; Wed, 09 Aug 2017 21:39:12 +0200
Original-Received: by mail-lf0-f72.google.com with SMTP id z12sf13209361lfd.8
        for <gclcip-std-proposals@m.gmane.org>; Wed, 09 Aug 2017 12:39:07 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1502307547; cv=pass;
        d=google.com; s=arc-20160816;
        b=pWEwBf3Agqjf+s5QLViL1cVIyb7g+Oy55eXjsBp6/59C8Bife/hiX65HDfYB0PROQW
         kpX5y9R2V005mtIpNn2v4lFvMpgNEmRc1KgeqP1l6n43Aai/J903aBxUeBatCwU5jCJW
         y2S5aE6L+Q3ZEqISNkbsONlAlN+Xw23ojq+i4G5Tcs/KQoZJwv+3XAMCdxB995lMpkNb
         a2PCQOOAYniOUYqUkPGSbdqA0d4R2RALjDplHcuuk2ihh68PIJSX/IjFyPs2xpy042sH
         strlJKVdqg0FkMhTOibwTnslE22LX0M5JD9YlOutsAseNKYl5cWWWjzBHlSEodA8iK2+
         5LOw==
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:mime-version:references
         :in-reply-to:message-id:date:subject:to:from
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=BGe59z3TKWqrftU2Sk2WBgYgpe0TfJ1otXSr6A6e1lQ=;
        b=OT/zN1IXiI5WlKGzXQ87tNyQG1YNlAqZk3pJ06JqqNVtp3aVxpDf7TdTBbuRD4nABL
         diQeeXUowEgk+A3P1oDvbjoHQsAEQrDNv5D2EW5vbtnZ+1k8bBYcIBH5RrlrulXcK5EC
         uR/3CXPI+0NmB2A2mu5cttogv26X+iyNw4RMMICdDf3ZTlrne6i+nB5Fs7iRIlopERc+
         2bFWNczH6r1tKrUKZ43OwZ3s1HpZeH5+rSzPKOWlo684PjoviqNnlKsg7Z2Cl7Po8nZb
         ACDZ1npcxO+sqiyBRyaQ6kaaLXolaRRJLsngqVyUaGDkQ1W0fjgfEnHlAoqTDcxj0fQ3
         2bsg==
ARC-Authentication-Results: i=2; 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
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
         :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=BGe59z3TKWqrftU2Sk2WBgYgpe0TfJ1otXSr6A6e1lQ=;
        b=QV+pT20ATM21aSVvNqt4CTbLHX5RwpuUOR5nHOCkgDZahzHJvnl6tczLv/abdIpXvX
         pNgl4T/ISu7yfUWSFdVtixX2Jy7IXYnMi0onwITWoUpJboM1TkLYd+fylajFKpFpoUym
         S9Lsf3h3ZGDli/hsRUbY0wXcUxqJkrN4YJfZEGS147+TnIBCSOg3OtTsygMWzA6IprJz
         hTKNQynx+JoRy7YRTz7xHLY9aK5nyCTKAjTfgNhxm/eNi007g1d6BDNsnHDbI1mRTm89
         1mRgbyYoBeW40/pJcYr9j5kZ4Rm+eW3deyhAqSG4gvxGd3f85gXSjQPs/FqpTTCN5Wnn
         r+Fw==
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: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=BGe59z3TKWqrftU2Sk2WBgYgpe0TfJ1otXSr6A6e1lQ=;
        b=oDnP5l8G0SMSBvIalG83oWPsXxCOamrB6EI/uoU3LuO+3vQAkaQ5U33Nd0fKkp2yo9
         jdtDwFMRA6mPGXPy2R+a0JLLfCzyhGyb2kTFt/3Y9gllJimCDW1mk5xpbOYZdPsMeugK
         CrbQnJ+v1yaXBItuAavfatRkrYfmZI3jIEZkzvOiYZD+05jsEY6xUDXATwsklIY89Dq/
         2esuXrYWNYpY1EKWg4Vwhk3OByOjDJm6Wsr911g8MfnupQw7hMGNRgUN7XYGQZb/Od+i
         bOqCWT3bZE5D0/DEk/qMYZeHsnt+KCZHiLAJwFWszlVJb3jpVU5w0X1rz+sVi7lhD516
         BsGA==
X-Gm-Message-State: AHYfb5jQCHbSFjxEpO9VohTlIgrc2NLm4cCtCKpX4loXmEON1/stB0BE
	g+/beIMtl8qiBz1G
X-Received: by 10.25.222.212 with SMTP id i81mr1206401lfl.29.1502307547584;
        Wed, 09 Aug 2017 12:39:07 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.225.68 with SMTP id y65ls29350wmg.11.gmail; Wed, 09 Aug
 2017 12:39:06 -0700 (PDT)
X-Received: by 10.223.131.99 with SMTP id 90mr6016822wrd.155.1502307546035;
        Wed, 09 Aug 2017 12:39:06 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1502307545; cv=none;
        d=google.com; s=arc-20160816;
        b=ex2PIz6bCpU8O5lf9Y6MQ0o+HYlM5KfTk6CfmhXJEYrnRIGvozifg5OJHb0do8BOYb
         lwikOGPvAU8g/WS9H6L6DolJfqP0Kc9tR9ftMiiw+Y8JadtUJya+dbxPYrk0Aro03/Zp
         sNBQV6JnzPxqVCkksvybAB2OcEJFPZeqvMlUvRwBFouTlOasc624zv0bB6wfxeuvJ1YZ
         rLojBNF9yQbAe+du7WkWMNtdAIooxPIz1mOlIRGDWImTcYAqj3WC4YK65ks2qnahwe4J
         rUvGk8AR2ZF3CwhD/jNMmmox4aexIHC4+8G7fdma0yFmhLqKQZbirmqz1mXD/GFnf4DE
         B9Tg==
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=etci8LYoeV/AgMxdgb/8XjcueO8xbImOj0C/ue90qzA=;
        b=YSjBJkVFuU+sZDFHK8B5KgjoMfT5S2/ov3/42sNjZ0kFBY9SoywwHrIizFqon/Q7B7
         lH6WpZM/XVZkqoI5BWKIKccG3EcQaxO0rO9BG6vKZn07w+Garm1FkdaUEf+8L8uUfwkl
         Gm4ca536Cxffdy79eA1ojYQUfO8zUh/VGLTziSsv5wgImq8zISMQydQGRoP9oGElecXM
         Ih6aFyxVmLwW0C8quO3vo1qbf5hOHY4SzNGRbilUX9XSDUTZxmdXMJsNKEQ3FCBnn+yG
         4XoDrq0nRwnAZf/O84Q+gGD6s3hg5vqLmg01PVFGZSyyo5PphvemYPWRYoEwOAUE4QD5
         HWmQ==
ARC-Authentication-Results: i=1; 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
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [78.47.120.188])
        by mx.google.com with ESMTP id b20si4104246wrf.100.2017.08.09.12.39.05
        for <std-proposals@isocpp.org>;
        Wed, 09 Aug 2017 12:39:05 -0700 (PDT)
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-mobl1.localnet (unknown [134.134.139.76])
	by gondolin.macieira.info (Postfix) with ESMTPSA id 0BEF511B6BB
	for <std-proposals@isocpp.org>; Wed,  9 Aug 2017 12:38:45 -0700 (PDT)
In-Reply-To: <CAOHCbisLgTxLz75Em3Had35AecQrtpRZKFWRaMXUZsSVtN7Fng@mail.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-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:33734
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33734>

On quarta-feira, 9 de agosto de 2017 10:08:14 PDT Tony V E wrote:
> So you have a pointer s, which is just an int, right?
> And all the cases are compile/link time constants...
> I'm not sure that was valid C, but it worked.  Many years ago.
> 
> Tony

Something like this?

	switch ("A") {
	case "A":
		return 0;
	case "B":
		return 1;
	default:
		return 2;
	}

It doesn't compile in C: https://godbolt.org/g/m9Asnk (Clang) & 
https://godbolt.org/g/Uy1pKW (GCC)

Even if it did, what do you think this would return? I'd say it's equally 
correct to return 0 or 2.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center

-- 
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/41733595.o4GQ0c89LU%40tjmaciei-mobl1.

.
